You need to sign in to do that
Don't have an account?
ScottB3
Trying to get a pageBlockSection to show/hide based upon the value of an inputField picklist
I have a visualforce page, on which I am trying to get a pageBlockSection to show/hide based upon the value of an inputField picklist.
I cannot seem to get the reRender function to work and am at a loss as to why.
Here is the code that I am using.
I cannot seem to get the reRender function to work and am at a loss as to why.
Here is the code that I am using.
<apex:pageBlockSection title="Case Type Selection" collapsible="false" columns="1" rendered="{!isChangeRequest == false && contains(lower($Profile.Name),'community') == false}"> <apex:repeat value="{!$ObjectType.Case.FieldSets.Standard_Case_Switcher_Fields}" var="f"> <apex:inputField value="{!Case[f.fieldPath]}" required="(f.required, f.dbrequired)" rendered="true"> <apex:actionSupport event="onChange" reRender="acInfo" immediate="true"/> </apex:inputField> </apex:repeat> </apex:pageBlockSection> <apex:pageBlockSection title="Account and Contact Info" collapsible="false" columns="1" rendered="{!IF(contains(Case.Service_Area__c, 'Chg Req'), true, false)}" id="acInfo"> <apex:repeat value="{!$ObjectType.Case.FieldSets.Standard_Case_Account_Contact_Fields}" var="f"> <apex:inputField value="{!Case[f.fieldPath]}" required="(f.required, f.dbrequired)"/> </apex:repeat> </apex:pageBlockSection>
<apex:pageBlockSection title="Account and Contact Info" collapsible="false" columns="1" rendered="{!IF(contains(Case.Service_Area__c, 'Chg Req'), true, false)}" id="acInfo">
What is happening here is this pageblocksection 'acInfo' is looking for a change in the value Case.Service_Area__c from the controller for it to be rendered, however, whenever you change the value of picklist in section 1, this change is all happening on the browser and not coming from the controller.
What you need to do is - add an action method on the page for on change such that it can change the value of Case.Service_Area__c in the controller so that this block is rendered
<apex:actionSupport event="onChange" reRender="acInfo" action="{!controllermethod}" immediate="true"/>