107
PrimeFaces Growl
It is a notification widget which is used to display FacesMessages. It is similar to standard h:messages component of JSF. We can place growl to anywhere in our application’s web page. The location of growl in JSF application does not matter.
By default it displays for 6000 ms after that hides. We can stick it by setting true. It has various other attributes that are tabled below.
Growl Attributes
Attribute | Default value | Type | Description |
---|---|---|---|
sticky | false | Boolean | It is used to specify that the message should stay instead of hidden automatically. |
showSummary | true | Boolean | It is used to show summery of the message. |
showDetail | false | Boolean | It is used to show detail of message. |
globalOnly | false | Boolean | It is used to set globally. |
life | 6000 | Integer | It is used to set display time of the message. |
autoUpdate | false | Boolean | It is used to set auto update mode. |
redisplay | true | Boolean | It is used to redisplay message. |
for | null | String | It is used to set name of associated key. |
escape | true | Boolean | It defines whether html would be escaped or not. |
severity | null | String | It is a comma separated list of severities to display only. |
Example
Here, in the following example, we are implementing <p:growl> component. This example contains the following files.
JSF File
// growl.xhtml
ManagedBean
// Growl.java
Output:
Next TopicPrimeFaces FileUpload