You need to sign in to do that
Don't have an account?
vikramkk
Section ishould be displayed based on a picklist value.
In a visualforce page, I want to display a section (say with id - payment) only if a picklist value is selected in the following code. The section should not be displayed on load of page. it is to be displayed only if a particular picklist value is selected.
<apex:pageBlockSectionItem id="ReturnTypeItem">
<apex:outputLabel for="ReturnType">Return Type</apex:outputLabel>
<apex:inputField required="true" id="ReturnType" value="{!Case.Return_Type__c}" />
</apex:pageBlockSectionItem>
Please help me on this. Many thanks.
Try this solution
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
All Answers
Try this solution
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
Hi
This is exactly what you wanted...
<apex:page standardController="Case">
<apex:form >
<apex:pageBlock >
<b>Case Origin</b>: <apex:inputField id="CaseOrigin" value="{!Case.Origin}">
<apex:actionSupport event="onchange"/>
</apex:inputField><br/><br/>
<apex:pageBlockSection id="sectionOne" rendered="{!Case.Origin=='Phone'}">
<apex:pageBlockSectionItem >
Case Reason : <apex:inputField value="{!Case.Reason}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="ReturnTypeItem" >
<apex:outputLabel for="ReturnType">Return Type</apex:outputLabel>
<apex:inputField required="true" id="ReturnType" value="{!Case.Return_Type__c}" />
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Did this post solve your error then please mark it solved...
Thanks
asish
Thanks Chamil and Ashish. It worked.