Reputation: 1532
Is it possible to set the growl life duration programmatically in my Bean?
Upvotes: 2
Views: 5779
Reputation: 20691
You can either
Bind the client-side growl component to a server-side instance of the same component
Growl growl = new Growl(); //Growl is from org.primefaces.component.growl.
growl.setLife(6000);
//getter & setter
and in your view:
<p:growl binding="#{myBean.growl}" autoUpdate="true" globalOnly="true" id="theGrowl" widgetVar="aGrowl"/>
Or use the following javascript call (by way of the RequestContext
if you prefer)
aGrowl.setRemovalTimeout(600);
Where aGrowl
is the widgetVar
value you would've configured on your <p:growl/>
component in your JSF view
Upvotes: 7
Reputation: 17525
The Growl class provides a setter for the life
property: Growl#setLife(int)
Upvotes: 0