The natural behaviour for a label attached to a checkbox button is to change the state of the button when it (the label) is clicked. This works in JSF and Richfaces.
Is there a way to make it work in Primefaces(3.5) without involving javascript ? Is this a bug ?
<p:outputLabel for="checkbox" value="Select it:" />
<p:selectBooleanCheckbox id="checkbox" label="My label" value="#{bean.value}" />
It doesn't work out-of-the-box in plain JSF but in Primefaces the itemLabel
attribute should do it:
<p:selectBooleanCheckbox id="checkbox" itemLabel="My label" ... />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With