I have a drop down list p:selectonemenu
and a checkbox p:selectbooleancheckbox
, when I select the checkbox, I want to set the selectonemenu
As Adrian Mitev pointed out in a comment, disabling the selectBooleanCheckbox
component will mean it will not post its value on a form submit.
What you can do however is have a hidden input field where you can set the value to the same managed bean property as the checkbox.
<h:inputHidden id="checkDisabled" value="#{managedBean.someValue}" />
Using a javascript you can set the value of this hidden input when the checkbox is disabled.