SelectBooleanButton SelectBooleanButton is used to select a boolean value using a button.
I accept terms and conditions:
No
Subscribe me to newsletter:
No
Values
Value 1: false
Value 2: false
<h:form>
    <p:growl id="msgs" />

    <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
        <h:outputText value="I accept terms and conditions: " />
        <p:selectBooleanButton id="value1" value="#{selectBooleanView.value1}" onLabel="Yes" offLabel="No" style="width:60px" />

        <h:outputText value="Subscribe me to newsletter: " />
        <p:selectBooleanButton id="value2" value="#{selectBooleanView.value2}" onLabel="Yes" offLabel="No" onIcon="ui-icon-check" offIcon="ui-icon-close" style="width:60px">
            <p:ajax update="msgs" listener="#{selectBooleanView.addMessage}" />
        </p:selectBooleanButton>
    </h:panelGrid>

    <p:commandButton id="submit" value="Submit" update="display" icon="ui-icon-check" oncomplete="PF('dlg').show()" />

    <p:dialog id="dialog" header="Values" modal="true" resizable="false" showEffect="fade" widgetVar="dlg">
        <h:panelGrid columns="1" id="display">
            <h:outputText value="Value 1: #{selectBooleanView.value1}" />
            <h:outputText value="Value 2: #{selectBooleanView.value2}" />
        </h:panelGrid>
    </p:dialog>
</h:form>
                
PrimeTek, Copyright © 2015
All rights reserved.
Running PrimeFaces-6.0.12 on Mojarra-2.2.8.