In this section, we will demonstrate how to block a specific region, such as a form, while the form submission background process is still running.
Create a user Registration Form and BlockUI component to block the form while registration is inprocess using the following code:
<p:growl autoUpdate="true"/> <h:form id="form1"> <p:panel header="BlockUI"> <h:panelGrid columns="2"> <h:outputLabel value="EmailId" /> <p:inputText value="#{blockUIController.registerUser.emailId}"/> <h:outputLabel value="Password" /> <p:password value="#{blockUIController.registerUser.password}"/> <p:commandButton id="submitBtn" value="Register" actionListener="#{blockUIController.doRegister}"/> </h:panelGrid> </p:panel> <p:blockUI block="form1" trigger="submitBtn"/> </h:form>
Create an action handler method
doRegister()
:public void doRegister() { //To simulate...