I want to render the second pageBlockSectionItem
when the stage of the picklist named "StageName" is "Lead Qualified"
My tags:
<apex:page standardController="Opportunity" extensions="GeoGradeSelectionController">
<apex:sectionHeader title="Lead" subtitle="{!Opportunity.Name}"/>
<apex:form >
<apex:pageBlock title="Lead Edit" id="pb" mode="edit">
<apex:pageBlockSection title="General Information">
<!-- FIRST PICKLIST WITH OPTION Lead Qualified -->
<apex:inputField value="{!Opportunity.StageName}">
<apex:actionSupport event="onchange" reRender="LeadQualified"/>
</apex:inputField>
<!-- SECOND PICKLIST TO RENDER ID STAGENAME="Lead Qualified" -->
<apex:pageBlockSectionItem rendered="{!opportunity.stageName == 'Lead Qualified'}" id="LeadQualified">
<apex:outputLabel value="Lead Qualified RecordType"/>
<apex:outputPanel styleClass="requiredInput" layout="block" id="pwPanel">
<apex:outputPanel styleClass="requiredBlock"/>
<apex:selectList value="{!Opportunity.LeadQualifiedRecordType__c}" size="1" required="true" multiselect="false">
<apex:selectOption itemValue="Opportunity" itemLabel="Opportunity"/>
<apex:selectOption itemValue="Proactive Selling Opportunity" itemLabel="Proactive Selling"/>
</apex:selectList>
</apex:outputPanel>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
The rerender for component with id="LeadQualified" is not working. Do you know why?
UPDATE:second version according to Ralph´s answer:
<apex:page standardController="Opportunity" extensions="GeoGradeSelectionController">
<apex:sectionHeader title="Lead" subtitle="{!Opportunity.Name}"/>
<apex:form >
<apex:pageBlock title="Lead Edit" id="pb" mode="edit">
<apex:pageBlockSection title="General Information">
<!-- FIRST PICKLIST WITH OPTION Lead Qualified -->
<apex:inputField value="{!Opportunity.StageName}">
<apex:actionSupport event="onchange" reRender="pb"/>
</apex:inputField>
<!-- SECOND PICKLIST TO RENDER ID STAGENAME="Lead Qualified" -->
<apex:inputField value="{!Opportunity.Name}"/>
<apex:inputField value="{!Opportunity.Probability}"/>
<apex:inputField value="{!Opportunity.AccountId}" required="true"/>
<apex:selectList value="{!Opportunity.LeadQualifiedRecordType__c}" size="1" required="true" multiselect="false" rendered="{!opportunity.stageName == 'Lead Qualified'}">
<apex:selectOption itemValue="Opportunity" itemLabel="Opportunity"/>
<apex:selectOption itemValue="Proactive Selling Opportunity" itemLabel="Proactive Selling"/>
</apex:selectList>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
It's still not working, please help me again.
UPDATE 2: solution according Nick.
<apex:page standardController="Opportunity" extensions="GeoGradeSelectionController">
<apex:sectionHeader title="Lead" subtitle="{!Opportunity.Name}"/>
<apex:form >
<apex:pageBlock title="Lead Edit" id="pb" mode="edit">
<apex:pageBlockSection title="General Information">
<!-- FIRST PICKLIST WITH OPTION Lead Qualified -->
<apex:inputField value="{!Opportunity.StageName}">
<apex:actionSupport event="onchange" reRender="LeadQualified"/>
</apex:inputField>
<!-- SECOND PICKLIST TO RENDER ID STAGENAME="Lead Qualified" -->
<apex:outputPanel id="LeadQualified">
<apex:pageBlockSectionItem rendered="{!opportunity.stageName == 'Lead Qualified'}" >
<apex:outputLabel value="Lead Qualified RecordType"/>
<apex:outputPanel styleClass="requiredInput" layout="block" id="pwPanel">
<apex:outputPanel styleClass="requiredBlock"/>
<apex:selectList value="{!Opportunity.LeadQualifiedRecordType__c}" size="1" required="true" multiselect="false">
<apex:selectOption itemValue="Opportunity" itemLabel="Opportunity"/>
<apex:selectOption itemValue="Proactive Selling Opportunity" itemLabel="Proactive Selling"/>
</apex:selectList>
</apex:outputPanel>
</apex:pageBlockSectionItem>
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
It´s working but it is giving wrong style to the field "LeadQualifiedRecordType":