TriStateCheckbox - since v6.0.1 TriStateCheckbox add a new state to a checkbox value.
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="ui-icon-plus"  
                             stateThreeIcon="ui-icon-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> 
                
PrimeTek, Copyright © 2015
All rights reserved.
Running PrimeFaces-6.0.12 on Mojarra-2.2.8.