Here is the example code from PrimeFaces showcase about <p:growl>
tag.In this example,when you click "Save" button,appears two messages are "Succesful" and "SecondMessage".
This link is what I'm talking about.
This is example code from PrimeFaces Showcase
<h:form>
<p:growl id="growl" showDetail="true" sticky="true" />
<p:panel header="Growl">
<h:panelGrid columns="2" cellpadding="5">
<p:outputLabel for="msg" value="Message:" />
<p:inputText id="msg"
value="#{growlView.message}"
required="true" />
</h:panelGrid>
<p:commandButton value="Save"
actionListener="#{growlView.saveMessage}"
update="growl" />
</p:panel>
</h:form>
And a bean GrowlView.java
from PrimeFaces Showcase again.
@ManagedBean
public class GrowlView {
private String message;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public void saveMessage() {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("Successful", "Your message: " + message) );
context.addMessage(null, new FacesMessage("Second Message", "Additional Message Detail"));
}
}
My question is, how can I make "Succesful" messages's sticky=true, SecondMessage's sticky=false?
I try to make this with two <p:growl>
tags with change second growl's position and sticky.But if you close the first growl,second growl's position not change like the PrimeFaces Showcase example.