JSF: when disable component, its value does not make into the request map parameter. Is there a workaround?

前端 未结 1 1894
既然无缘
既然无缘 2020-12-18 03:53

I have a drop down list p:selectonemenu and a checkbox p:selectbooleancheckbox, when I select the checkbox, I want to set the selectonemenu

相关标签:
1条回答
  • 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.

    0 讨论(0)
提交回复
热议问题