![PrimeFaces Beginner's Guide](https://wfqqreader-1252317822.image.myqcloud.com/cover/299/36705299/b_36705299.jpg)
上QQ阅读APP看书,第一时间看更新
Displaying notifications using the growl component
The PrimeFaces Growl component is similar to MAC OS's growl notification widget, which can be used to display FacesMessage
. The Growl component is similar to the Messages component, and thus have similar attributes to customize its behavior.
We can use the following attributes to customize the Growl components behavior:
autoUpdate
: When enabled, growl is updated for each AJAX request implicitly.severity
: It is a comma-separated list of severity levels for display purposes only.globalOnly
: Whentrue
, only theFacesMessage
without client IDs are displayed. Default isfalse
.sticky
: It specifies whether the message should stay instead of being hidden automatically. Default isfalse
.life
: It is the duration in milliseconds to display non-sticky messages. Default is 6000 ms.for
: Identifier of the component whose messages to display only, takes precedence when used withglobalOnly
.escape
: It defines whether HTML would be escaped or not, defaults totrue
.
Let us see how to use the <p:growl>
component to display the FacesMessage objects
as follows:
![Displaying notifications using the growl component](https://epubservercos.yuewen.com/548F48/19470456408215806/epubprivate/OEBPS/Images/0698_03_04.jpg?sign=1738882069-BMTZgXLrHloZn2hlguqqQMPOf8TRKa2c-0-e5b354fa35ec4e2ee23202cae8c9a38c)