在两个p:growl中显示基于严重性的消息 [英] Show messages based on Severity in two p:growl
问题描述
我正在使用PrimeFaces p:growl.
I'm using PrimeFaces p:growl.
<p:growl id="msgsInfo"
rendered="true"
showDetail="true" />
<p:growl id="msgsError"
globalOnly="true"
showDetail="true"
sticky="true" />
我只需要在第一声咆哮中显示Info
消息,而在第二次中,我需要显示Error
消息.
当我添加错误消息时,使用globalOnly
会显示2次.
I need to show in the first growl only Info
messages while in the second I need to show Error
messages.
Using globalOnly
when I add error message this is show 2 times.
有什么主意吗?
推荐答案
从理论上讲,如果它支持infoClass
,errorClass
等属性,例如h:messages
,则是可能的.然后,您可以只指定执行display: none
的CSS类.
It would in theory be possible if it supported infoClass
, errorClass
, etc attributes like as h:messages
. You could then just specify a CSS class which does a display: none
.
但是p:growl
不支持这些属性.在严重性级别上,您只能通过按infoIcon
,errorIcon
等更改图标.所以您在这里很迷路.
But the p:growl
doesn't support those attributes. On the severity level all you can do is changing the icon by infoIcon
, errorIcon
, etc. So you're pretty lost here.
可能值得一个功能请求.
请注意,globalOnly="true"
仅显示具有null
客户端ID的邮件,无论其严重性如何.
Note that the globalOnly="true"
only displays messages which have a null
client ID, regardless of their severity.
这篇关于在两个p:growl中显示基于严重性的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!