jsf - Enabling and disabling components via select checkbox -
i have component , i'm trying disable panelgrid below.
<h:selectbooleancheckbox id="checkboxid" value="#{bean.checked}"> <p:ajax update="panelid" event="click"/> </h:selectbooleancheckbox> <h:panelgrid id="panelid" rendered="#{!bean.checked}"> <h:outputlabel>some text</h:outputlabel> <h:outputlabel>#registrationbb.registrationmodel.homeaddress.actualaddressmathwithregistration}</h:outputlabel> </h:panelgrid>
as result clicking on checkbox doesn't take no effect. check indicator doesn't appear on checkbox component , value bean:checked doesn't sent server. tried use also. check indicator appeared panel not refreshed
how use update via checkbox right?
the example below got work:
<h:form> <h:selectbooleancheckbox id="checkboxid" value="#{indexbean.checked}" > <p:ajax event="change" update="panelid" /> </h:selectbooleancheckbox> <h:panelgrid id="panelid" style="border:solid 1px black;" > <h:outputlabel rendered="#{!indexbean.checked}" >some text</h:outputlabel> <h:outputtext rendered="#{!indexbean.checked}" value="some text 2" /> </h:panelgrid> </h:form>
i had change <p:ajax>
event click change checkbox working. other issue if don't render <h:panelgrid>
id can not found update, want move rendered attribute components inside <h:panelgrid>
still update <h:panelgrid>
.
Comments
Post a Comment