Growl
Growl brings the Mac's growl widget to JSF with the ability of displaying FacesMessages. Growl simply replaces h:messages component.
Growl brings the Mac's growl widget to JSF with the ability of displaying FacesMessages. Growl simply replaces h:messages component.
<h:form>
<p:growl id="growl" showDetail="true" sticky="true" />
<p:panel header="Growl">
<h:panelGrid columns="2">
<h:outputText value="Your Name: *" />
<p:inputText value="#{growlBean.text}" required="true" label="Name"/>
</h:panelGrid>
<p:commandButton value="Save" actionListener="#{growlBean.save}" update="growl"/>
</p:panel>
</h:form>
package org.primefaces.examples.view;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
public class GrowlBean {
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public void save(ActionEvent actionEvent) {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("Successful", "Hello " + text));
context.addMessage(null, new FacesMessage("Second Message", "Additional Info Here..."));
}
}
Running PrimeFaces-4.0-SNAPSHOT on Mojarra-2.1.20
