O'Reilly logo

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

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

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 ...

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