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 – using the SelectBooleanCheckbox component

Let us see how to use <p:selectBooleanCheckbox> along with the AJAX listener support, by performing the following step:

  1. 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> ...

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