+ Start a Discussion
Lago S.p.a.Lago S.p.a. 

Picklist values can display different sections on a visualforce page

Hi everybody , my issue is about a visualforce page in which I want to see a different section based on different picklist values.

Now, I've tried different ways to find out with no results :(

I'll paste my code now, can you please suggest me how to solve my problem?
Thanks in advance

<apex:page standardController="pacchetto_mkt__c">
    <apex:variable value="{!pacchetto_mkt__c.Contract__c}" var="contract"/>
     <apex:variable value="{!pacchetto_mkt__c.AccountF__c}" var="account"/>
     <apex:variable value="{!pacchetto_mkt__c.Tipologia__c}" var="tipologia"/>
        <apex:define name="Header">
         <apex:sectionHeader title="{!$ObjectType.pacchetto_mkt__c.label}" subtitle="{!pacchetto_mkt__c.name&' per '&$ObjectType.Account.label&' : '&pacchetto_mkt__c.Contract__r.Account.Name}"/>
            <apex:form >
                <apex:pageBlock mode="edit">
                    <apex:pageBlockButtons location="top">
                        <apex:commandButton value="Save" action="{!save}"/>
                        <apex:commandButton value="Cancel" action="{!cancel}"/>
                        <apex:commandButton action="{!edit}" value="Edit"/>
                        <apex:commandButton action="{!delete}" value="Delete"/>
                    </apex:pageBlockButtons>
                    <apex:actionRegion >
                    <apex:pageBlockSection columns="2" title="Pacchetto Marketing">
                        <apex:inputField value="{!pacchetto_mkt__c.anno_opzione__c}"/>
                        <apex:outputField value="{!pacchetto_mkt__c.AccountF__c}"/>
                        <apex:inputField value="{!pacchetto_mkt__c.Contract__c}"/>
                        <apex:inputField value="{!pacchetto_mkt__c.quantita__c}"/>
                        <apex:inputField value="{!pacchetto_mkt__c.Tipologia__c}">
                            <apex:actionSupport event="onchange" rerender="youtube"/>
                        </apex:inputField>
                        <apex:inputField value="{!pacchetto_mkt__c.price_pkt__c}"/>
                        <apex:pageBlockSection columns="1">
                            <apex:inputField value="{!pacchetto_mkt__c.start_date__c}"/>
                            <apex:inputField value="{!pacchetto_mkt__c.end_date__c}"/>
                        </apex:pageBlockSection>
                        <apex:pageBlockSectionItem >
                            <apex:outputLabel value="LastModifiedBy"/>
                            <apex:outputText >
                                <apex:outputField value="{!pacchetto_mkt__c.LastModifiedById}"/>&nbsp;
                                <apex:outputField value="{!pacchetto_mkt__c.LastModifiedDate}"/>
                            </apex:outputText>
                        </apex:pageBlockSectionItem>
                    </apex:pageBlockSection>
                    </apex:actionRegion>
                    <apex:outputPanel id="youtube">
                        <!--<apex:pageBlockSection id="youtube" title="Dettagli Pacchetto" columns="1">-->
                            <!--<apex:pageBlockSection id="test" title="Dettagli Pacchetto" columns="1" rendered="{IF ISPICKVAL(!pacchetto_mkt__c.Tipologia__c,'Campagna web local Youtube - Start D'),true,false)}">-->
                        <apex:pageBlockSection id="section1" title="Dettagli Pacchetto" columns="1" rendered="{!pacchetto_mkt__c.Tipologia__c =='Campagna web local Youtube - Start D'}">
                           <apex:inlineEditSupport event="ondblClick">
                            <apex:inputField value="{!pacchetto_mkt__c.youtube_start__c}"/>
                            <apex:inputField value="{!pacchetto_mkt__c.youtube_end__c}"/>
                              </apex:inlineEditSupport>
                            </apex:pageBlockSection>
                        <!--</apex:pageBlockSection>-->
                        </apex:outputPanel>
                </apex:pageBlock>
            </apex:form>   
     </apex:define>
</apex:page>