As Dmitry from Openfaces stated, enabling / disabling edge components (Primefaces, Openfaces, Richfaces ... etc.) should be done on the server side. The best solution to continue to use ajax when triggering a change event! onchange is suitable for this situation (imagine that the checkbox is checked or unchecked from the keyboard, for example)!
<h:selecBooleanCheckbox id="box" value="#{mybean.selecteditem.booleanvalue}"......> <f:ajax execute="box" render="but" event="change" /> </h:selectBooleanCheckbox> <h:commandButton id="but" action="someAction" value="someValue" disabled="#{!mybean.selecteditem.booleanvalue}" />
Thus, when the box is unchecked, the "Team" button is disabled, but when it is installed, the button is turned on.
In the case of Application using <p:ajax /> recommended!
<p:ajax event="change" process="box" update="but"/>
In the case of OpenFaces, both the <f:ajax /> and <o:ajax /> functions work fine.
And if you have several components for rendering at the same time, juste includes their identifiers, the space is divided:
<f:ajax ......render="id1 id2 id3" />
source share