Time for action – displaying FacesMessage using <p:message>
Let us see how to display FacesMessages with different display modes and severity levels.
- Create a form with three required input fields and display validation errors using
<p:message>
as follows:<h:form id="userRegForm" style="width: 500px; padding-left: 10px;"> <p:panel header="Messages - Using 'display' modes" > <h:panelGrid columns="3"> <p:outputLabel value="EmailId"/> <p:inputText id="emailId" value="#{messagesController.user.emailId}" required="true" requiredMessage="Enter EmailId"/> <p:message for="emailId"/> <h:outputText value="Password" /> <p:password id="password" value="#{messagesController.user.password}" required="true" requiredMessage="Enter Password"...