You need to sign in to do that
Don't have an account?
SeanCeno
Visualforce Rerendering Issue
All,
I'm trying to display a pageBlockSection based on the value of a picklist. But when I make the selection in the picklist, the pageBlockSection is not displayed. I have also tried wrapping it in an outputPanel container as well. Is my syntax incorrect in the rendered attribute? Here is a snippet of my code:
I'm trying to display a pageBlockSection based on the value of a picklist. But when I make the selection in the picklist, the pageBlockSection is not displayed. I have also tried wrapping it in an outputPanel container as well. Is my syntax incorrect in the rendered attribute? Here is a snippet of my code:
<apex:pageBlockSection title="Pre-Approval Form Required?" columns="2" rendered="{!NOT(ISBLANK(marketingReimbursementForm))}" collapsible="True"> <apex:pageBlockSectionItem > <apex:outputLabel value="{!$ObjectType.Marketing_Reimbursement__c.Fields.Pre_Approval_Required__c.Label}" /> <apex:outputPanel layout="block" styleClass="requiredBlock"> <apex:actionRegion> <apex:inputField value="{!MarketingReimbursement.Pre_Approval_Required__c}" required="true"> <apex:actionSupport event="onchange" rerender="preApprovalFormContainer" /> </apex:inputField> </apex:actionRegion> </apex:outputPanel> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:outputPanel id="preApprovalFormContainer"> <apex:pageBlockSection id="preApprovalForm" title="Pre-Approval Form" columns="2" rendered="{!(marketingReimbursement.Pre_Approval_Required__c =='Yes')}" collapsible="False"> <apex:pageBlockSectionItem > <apex:outputLabel value="{!$ObjectType.Marketing_Reimbursement_Forms__c.Fields.Northstar_Registered_Representative__c.Label}" /> <apex:outputPanel layout="block" styleClass="requiredInput"> <apex:inputField value="{!marketingReimbursementForm.Northstar_Registered_Representative__c}" required="true"/> </apex:outputPanel> </apex:pageBlockSectionItem>
Try to re-render the entire pageBlock instead of trying to re-render just the one inputField.
Please refer below links for similar discussion that may help you.
http://salesforce.stackexchange.com/questions/42745/action-support-rerender-not-working
https://developer.salesforce.com/forums/?id=906F000000095w2IAA
http://salesforce.stackexchange.com/questions/69948/visualforce-action-support-rerender-not-working
Hope this helps you!
If this helps you please mark it as solved.
Thanks and Regards
Sandhya
Thanks for the reply. I tried rerendering the pageBlock and that just ends up rerendering the page and changing the picklist value back to default of null. I also looked at your links which all recommend wrapping the pageBlockSection in an outputPanel, which I've done. I've also tried removing the actionRegion, which the 3rd link suggested. Is it not possible to render a pageBlockSection based on the selection of an input field of another pageBlockSection? Meaning, does it need to be a pageBlockSectionItem like a Parent-Child relationship? Here is the full VF Page thus far if that helps: