rich:notifyMessage/-s allows one to consume standard JSF messages similarly to rich:message/-s. but notifications are displayed in floating box like in operation system.
If you don't want use JSF messages concept, you can also use rich:notify, which displays the notification directly when rendered and when re-rendered.
Components allow following ways how to raise notification box:
Following sample combines both, standard messages and notifications to achieve full-featured user interaction.
<!DOCTYPE html> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <rich:panel> <f:facet name="header"> <h:outputText value="Validation Form" /> </f:facet> <h:form id="form"> <h:panelGrid columns="3"> <rich:validator event="change"> <h:outputText value="Name:" /> <h:inputText label="Name" id="name" value="#{userBean.name}" required="true"> <f:validateLength minimum="3" /> </h:inputText> <rich:message for="name" ajaxRendered="true" /> <h:outputText value="Job:" /> <h:inputText label="Job" id="job" value="#{userBean.job}" requiredMessage="Job is required"> <f:validateLength minimum="3" maximum="50" /> </h:inputText> <rich:message for="job" ajaxRendered="true" /> <h:outputText value="Address:" /> <h:inputText label="Address" id="address" value="#{userBean.address}" requiredMessage="Address is required"> <f:validateLength minimum="10" /> </h:inputText> <rich:message for="address" ajaxRendered="true" /> <h:outputText value="Zip:" /> <h:inputText label="Zip" id="zip" value="#{userBean.zip}" requiredMessage="Zip is required"> <f:validateLength minimum="4" maximum="9" /> </h:inputText> <rich:message for="zip" ajaxRendered="true" /> </rich:validator> <rich:notifyMessages stayTime="2000" nonblocking="true" /> <f:facet name="footer"> <a4j:commandButton value="Ajax Validate" /> </f:facet> </h:panelGrid> </h:form> </rich:panel> </ui:composition>