在两个p:growl中显示基于严重性的消息 [英] Show messages based on Severity in two p:growl

查看:152
本文介绍了在两个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.

有什么主意吗?

推荐答案

从理论上讲,如果它支持infoClasserrorClass等属性,例如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不支持这些属性.在严重性级别上,您只能通过按infoIconerrorIcon等更改图标.所以您在这里很迷路.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆