I have a VF page to make a record for a custom object. It has 2 <pageBlockSection>
. The first should always be rendered, and it contains a picklist. Depending on the value of the picklist, the second might be rendered.
What is the best way to go about this? Can the standard controller handle this, or does it need a custom controller? Why isn't my second section rendering correctly?
The picklist:
<apex:inputField value="{!CustomObject__c.Type__c}">
<apex:actionSupport event="onchange" reRender="section2"/>
</apex:inputField>
And the second section:
<apex:pageBlockSection id="section2" columns="1" rendered="{!IF(CustomObject__c.Type__c == 'Functionality Request',true,false)}">
<apex:inputField value="{!CustomObject__c.Priority__c }"/>
</apex:pageBlockSection>
rendered="{!(CustomObject__c.Type__c == 'Functionality Request')}"
=
is an assignment whereas==
is a comparison.