O'Reilly logo

PrimeFaces Cookbook by Mert Çalışkan, Oleg Varaksin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Discovering selectBooleanCheckbox and selectManyCheckbox

selectBooleanCheckbox and selectManyCheckbox extend the default JSF components <h:selectBooleanCheckbox> and <h:selectManyCheckbox> respectively to provide skinning.

How to do it...

Basic definitions for selectBooleanCheckbox and selectManyCheckbox would be as follows:

<p:selectBooleanCheckbox value="#{selectCheckboxController.selectedValue}" />

<p:selectManyCheckbox value="#{selectCheckboxController.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. itemLabel ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required