可以在一页中使用两个咆哮声 [英] is possible use two growls in one page
本文介绍了可以在一页中使用两个咆哮声的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要在一页中使用两个咆哮声.一种用于显示可以自动隐藏(sticky="false")
)的成功消息,另一种用于显示不能自动隐藏(sticky="true"
)的失败消息:
I want to use two growls in one page. One use to show success message that do auto hide (sticky="false")
, the other one use to show failed messages that do not auto hide (sticky="true"
):
<p:growl id="globalSuccessMessageGrowl" showDetail="false"
showSummary="true" life="3000" />
<p:growl id="globalFailedMessageGrowl" showDetail="false"
showSummary="true" sticky="true" />
public static void globalSuccessMessage(String message,
FacesMessage.Severity severity) {
FacesContext.getCurrentInstance().getViewRoot().findComponent("globalSuccessMessageGrowl");
renderComponent(new FacesMessage(severity, message, message), null,
"globalSuccessMessageGrowl");
}
public static void globalFailedMessage(String message,
FacesMessage.Severity severity) {
renderComponent(new FacesMessage(severity, message, message), null,
"globalFailedMessageGrowl");
}
...但是两声咆哮不会在3秒后自动隐藏.咆哮声失败会成功咆哮吗?
...but the two growls do not auto hide after 3 seconds. Failed growl effects success growls?
推荐答案
您可以为每个严重性级别分配不同的严重性级别.这是在3.3版中添加到primefaces的一个属性.
You can assign different severity levels to each one. This was an attribute added to primefaces in version 3.3.
检查此问题.用户遇到了与您相同的问题.
Check this question . The user had the same problem as you do.
这篇关于可以在一页中使用两个咆哮声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文