O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – displaying FacesMessage using <p:message>

Let us see how to display FacesMessages with different display modes and severity levels.

  1. 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"/> <p:message for="password" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required