Take the 2-minute tour ×
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.

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

1 Answer 1

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

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.