Growl
Growl displays facesmessages in an overlay.
Source
<h:form> <p:growl id="growl" showDetail="true" /> <pm:field> <p:outputLabel for="name" value="Name:" /> <p:inputText id="name" value="#{growlView.message}" required="true" label="Name" /> </pm:field> <p:commandButton id="btn" value="Save" actionListener="#{growlView.saveMessage}" update="growl" icon="ui-icon-check"/> </h:form>
package org.primefaces.showcase.view.message; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.context.FacesContext; @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")); } }