P: selectBooleanCheckbox and tag attached to it

The natural behavior of a label attached to a flag button is to change the state of the button when you click on it (label). This works in JSF and Richfaces.

Is there a way to make it work in Primefaces (3.5) without involving javascript? This is mistake?

<p:outputLabel for="checkbox" value="Select it:" />
<p:selectBooleanCheckbox id="checkbox" label="My label" value="#{bean.value}" />
+5
source share
1 answer

It does not work because of the box in plain JSF, but in Primefaces the attribute itemLabelshould do this:

<p:selectBooleanCheckbox id="checkbox" itemLabel="My label" ... />
+13
source

All Articles