TriStateCheckbox

TriStateCheckbox add a new state to a checkbox value.

Documentation
Basic Usage:
Ajax Behavior:
Customs Icons:
Item Label
Selected Values
Value 1: 2
Value 2:
Value 3:
Value 4: 1
<h:form>
    <p:growl id="growl" showDetail="true"/>  

    <h:panelGrid id="triStateGrid" columns="2" cellpadding="5">  
        <h:outputText value="Basic Usage: "/>  
        <p:triStateCheckbox value="#{triStateCheckboxView.value1}"/>  

        <h:outputText value="Ajax Behavior: "/>  
        <p:triStateCheckbox id="ajaxTriState" value="#{triStateCheckboxView.value2}">  
            <p:ajax event="change" update="growl" listener="#{triStateCheckboxView.addMessage}"/>  
        </p:triStateCheckbox>  

        <h:outputText value="Customs Icons: "/>  
        <p:triStateCheckbox value="#{triStateCheckboxView.value3}"  
                             stateTwoIcon="pi pi-plus"  
                             stateThreeIcon="pi pi-minus"/>  

        <h:panelGroup/>  
        <p:triStateCheckbox value="#{triStateCheckboxView.value4}" itemLabel="Item Label"/>                  
    </h:panelGrid>  

    <p:commandButton value="Submit" process="triStateGrid" update="display" oncomplete="PF('dlg').show()"  
                     style="margin-top:10px;"/>  

    <p:dialog header="Selected Values" showEffect="fade" hideEffect="fade" widgetVar="dlg">  
        <h:panelGrid id="display" columns="1" style="margin: 10px;">  
            <h:outputText value="Value 1: #{triStateCheckboxView.value1}"/>  
            <h:outputText value="Value 2: #{triStateCheckboxView.value2}"/>  
            <h:outputText value="Value 3: #{triStateCheckboxView.value3}"/>  
            <h:outputText value="Value 4: #{triStateCheckboxView.value4}"/>  
        </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.