SelectBooleanButton

SelectBooleanButton is used to select a boolean value using a button.

Documentation
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="pi pi-check" offIcon="pi pi-times" style="width:60px">
            <p:ajax update="msgs" listener="#{selectBooleanView.addMessage}" />
        </p:selectBooleanButton>
    </h:panelGrid>

    <p:commandButton id="submit" value="Submit" update="display" icon="pi pi-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>

FREE THEMES

Built-in component themes created by the PrimeFaces Theme Designer.

nova-light Nova-Light
nova-dark Nova-Dark
nova-colored Nova-Colored
luna-blue Luna-Blue
luna-amber Luna-Amber
luna-green Luna-Green
luna-pink Luna-Pink
omega Omega

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.