You need to sign in to do that
Don't have an account?
Dylan Conley
Rerender inputField on inputCheckbox change not working
I'm trying to do something similar to what's been posted here and have literally copied the code without success. To summarize, I'm trying to rerender fields (or a pageBlockSection) when I check an inputCheckbox using apex:actionsupport.
Here's the VF (taken from the referenced thread):
<apex:pageBlockSection id="debugBlock" rendered="{!IF(test2 == true,true,false)}" > Checked </apex:pageBlockSection> <apex:inputCheckbox value="{!test2}"> <apex:actionsupport event="onchange" rerender="debugBlock" /> </apex:inputCheckbox>
I've also tried with rendered="{!test2}" and had no luck.
Here's the controller code:
public boolean test2 {get; set;}
Pretty strange considering almost identical code worked in the previous thread. Any help is greatly appreciated.
Thanks,
Dylan
Hi Dylan Conley
try this code
All Answers
I have also had issues with rerender. Since you are using an inputCheckbox, I am assuming that this is nested within <Apex:Form> tags. Try rerendering the entire form, instead of this one element. I've found that to work in most cases.
Hi Dylan Conley
try this code
Thanks for the quick responses. JD, your solution worked! Posted below with a "/" on the closing outputPanel.
Thanks!
Dylan
Hi ,
Solution work for me as well but why do inputcheckbox need to put within the outpanel to rerender it?
why is it not working for the checkbox outside?