You need to sign in to do that
Don't have an account?
Problems with page rerendering!!!!
Hi All,
I have been facing issues with rerendering of outputpanels..
<apex:selectRadio value="{!country}"> <apex:actionSupport event="onclick" reRender="emailservices"/> <apex:selectOptions value="{!items}"/> </apex:selectRadio> <apex:outputpanel id="emailservices" rendered="{!country== 'YES'}"> Select the Email service to be used <apex:selectList value="{!emailservice}" size="1"> <apex:actionSupport event="onchange" reRender="emailaddress" /> <apex:selectOptions value="{!servicenames}"/> </apex:selectList> <br/> <br/> </font> <apex:outputpanel id="mailserv" id="emailaddress" rendered="{!emailservice != NULL}" > Select the Email address to be used <apex:selectList value="{!mailaddress}" size="1" > <apex:selectOptions value="{!mailaddresslist}"/> </apex:selectList> </apex:outputpanel> </apex:outputpanel>
Am i going wrong anywhere...
Thanks in advance
The reRender attribute only rerenders the output panel's children. With this in mind, trying to reRender an output panel that is not being rendered will not do anything.
Try wrapping your output panels in another output panel and reRendering that:
<apex:selectRadio value="{!country}"> <apex:actionSupport event="onclick" reRender="emailServicesWrapper" /> <apex:selectOptions value="{!items}"/> </apex:selectRadio> <apex:outputPanel id="emailServicesWrapper"> <apex:outputpanel id="emailservices" rendered="{!country== 'YES'}"> Select the Email service to be used <apex:selectList value="{!emailservice}" size="1"> <apex:actionSupport event="onchange" reRender="emailAddressWrapper" /> <apex:selectOptions value="{!servicenames}"/> </apex:selectList> <br/> <br/> <apex:outputPanel id="emailAddressWrapper"> <apex:outputpanel id="emailaddress" rendered="{!emailservice != NULL}" > Select the Email address to be used <apex:selectList value="{!mailaddress}" size="1" > <apex:selectOptions value="{!mailaddresslist}"/> </apex:selectList> </apex:outputpanel> </apex:outputPanel> </apex:outputpanel> </apex:outputPanel>
All Answers
The reRender attribute only rerenders the output panel's children. With this in mind, trying to reRender an output panel that is not being rendered will not do anything.
Try wrapping your output panels in another output panel and reRendering that:
<apex:selectRadio value="{!country}"> <apex:actionSupport event="onclick" reRender="emailServicesWrapper" /> <apex:selectOptions value="{!items}"/> </apex:selectRadio> <apex:outputPanel id="emailServicesWrapper"> <apex:outputpanel id="emailservices" rendered="{!country== 'YES'}"> Select the Email service to be used <apex:selectList value="{!emailservice}" size="1"> <apex:actionSupport event="onchange" reRender="emailAddressWrapper" /> <apex:selectOptions value="{!servicenames}"/> </apex:selectList> <br/> <br/> <apex:outputPanel id="emailAddressWrapper"> <apex:outputpanel id="emailaddress" rendered="{!emailservice != NULL}" > Select the Email address to be used <apex:selectList value="{!mailaddress}" size="1" > <apex:selectOptions value="{!mailaddresslist}"/> </apex:selectList> </apex:outputpanel> </apex:outputPanel> </apex:outputpanel> </apex:outputPanel>
Thanks a lot.. thatworked great..
I have one more problem.. I need to have two conditions in the rendered attribute
eg: rendered="{!emailservice != '--None--'} || {!emailservice != NULL}" ... I this syntax correct, if yes the rendering doesnt work for the condition
Thanks in advance
The || has to be included in the conditions (I also think && would work better):
rendered="{!emailservice != '--None--' && emailservice != NULL}"