Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a visual force page which contain a picklist with values 'yes' and 'no' and there is another section which contain a number of fields. So what is required is that on yes ,the section appears and on 'no' the section is hidden.

share|improve this question

You can achieve this using actionSupport that triggers on the change of the picklist and rerenders the output panel. The ouput panel only shows if the picklist value is not null and is equals to "yes" (formula required). Here is a simple example of how you can implement this:

<apex:inputField value="{!object.MyPickList__c}">
    <apex:actionSupport event="onchange"
                        rerender="MyPanel"/>
</apex:inputField>

<apex:outputPanel id="MyPanel">
    <apex:outputPanel rendered="{!IF(NOT(ISBLANK(object.MyPickList__c)) && 
                                     ISPICKVAL(object.MyPickList__c, 'yes'),true,false)}">
        ...
    </apex:outputPanel>
</apex:outputPanel>
share|improve this answer
    
does ` ISPICKVAL(object.MyPickList__c, 'yes'),true,false)}">` work? I have ISPICKVAL(Request_for_System_Change__c.Request_Priority__c, 'High') and get an error: "Save error: Incorrect parameter type for function 'ISPICKVAL()'. Expected Picklist, received Text" – Our Man In Bananas Jan 5 at 16:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.