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 – creating dialog with a registration form

In this section, we will demonstrate how to use forms in Dialog components and close the dialog conditionally such as in a successful form submission.

  1. Create a dialog containing a user Registration Form using the following code:
    <p:messages id="globalMsgs" globalOnly="true" autoUpdate="true"/> <h:outputLink id="registerLink" value="javascript:void(0)" onclick="registrationDlg.show()" title="Registration"> <p:outputLabel value="Register"/> </h:outputLink> <p:dialog id="registrationDlgId" widgetVar="registrationDlg" header="Registration Form" focus="registrationFormDlg:firstName"> <h:form id="registrationFormDlg"> <p:messages id="regmsgs" severity="error"/> <h:panelGrid columns="2" width="400px"> ...

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