Discovering selectBooleanCheckbox and selectManyCheckbox
To provide skinning, selectBooleanCheckbox
and selectManyCheckbox
extend the default JSF components <h:selectBooleanCheckbox>
and <h:selectManyCheckbox>
, respectively.
How to do it…
Basic definitions for selectBooleanCheckbox
and selectManyCheckbox
would be as follows:
<p:selectBooleanCheckbox value="#{selectCheckboxBean.selectedValue}" /> <p:selectManyCheckbox value="#{selectCheckboxBean.selectedCountries}"> <f:selectItem itemLabel="Turkey" itemValue="Turkey" /> <f:selectItem itemLabel="Germany" itemValue="Germany" /> <f:selectItem itemLabel="Switzerland" itemValue="Switzerland" /> </p:selectManyCheckbox>
Adding labels to the checkbox is easy with the itemLabel
attribute. The itemLabel
attribute displays a label next to the checkbox:
<p:selectBooleanCheckbox value="#{selectCheckboxBean...