Time for action – using the SelectBooleanCheckbox component
Let us see how to use <p:selectBooleanCheckbox>
along with the AJAX listener support, by performing the following step:
- Create the User Preferences form using
<p:selectBooleanCheckbox>
components:<h:form> <p:panel header="User Preferences" style="width: 500px;"> <p:messages/> <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5"> <h:outputText value="Show Online Status: " /> <p:selectBooleanCheckbox value="#{selectionController.showOnlineStatus}" /> <h:outputText value="Accept Private Messages: " /> <p:selectBooleanCheckbox value="#{selectionController.recievePrivateMsgs}"> <p:ajax update="display" listener="#{selectionController.updateUserpreferences}"/> </p:selectBooleanCheckbox...