I want to display a section based on the record type,
<apex:page standardController="Interviewers_Feedback__c" extensions="ControllerFeedback">
<apex:form id="theForm">
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!QuickSave}" rerender="theForm" />
</apex:pageBlockButtons>
<apex:messages />
<apex:pageBlock >
<apex:pageBlockSection >
<apex:selectList value="{!Interviewers_Feedback__c.RecordTypeID}" >
<apex:selectOptions value="{!RecordTypes}" />
</apex:selectList>
<apex:inputField value="{!Interviewers_Feedback__c.Job_Application__c}"/>
<apex:inputField value="{!Interviewers_Feedback__c.Name}"/>
</apex:pageBlockSection>
<apex:pageblock >
<apex:pageBlockSection title="CEO" >
<apex:inputField value="{!Interviewers_Feedback__c.CEO_Comments__c}" rendered="{!Interviewers_Feedback__c.RecordType='CEO'}"/>
<apex:inputField value="{!Interviewers_Feedback__c.CEO_Conclusion__c}" rendered="IF(Interviewers_Feedback__c.RecordType='CEO',true,false)" />
</apex:pageBlockSection>
</apex:pageblock>
<apex:pageblock >
<apex:pageBlockSection title="HR">
<apex:inputField value="{!Interviewers_Feedback__c.HR_Comments__c}"/>
<apex:inputField value="{!Interviewers_Feedback__c.HR_Conclusion__c}"/>
</apex:pageBlockSection>
</apex:pageblock>
<apex:pageblock >
<apex:pageBlockSection title="Technical">
<apex:inputField value="{!Interviewers_Feedback__c.Technical_Comments__c}"/>
<apex:inputField value="{!Interviewers_Feedback__c.Technical_Conclusion__c}"/>
</apex:pageBlockSection>
</apex:pageblock>
</apex:pageBlock>
</apex:pageBlock>
</apex:form>
public class ControllerFeedback {
Interviewers_Feedback__c t;
ApexPages.StandardController controller;
public ControllerFeedback(ApexPages.StandardController controller) {
this.controller = controller;
t = (Interviewers_Feedback__c) Controller.getRecord();
}
public list<SelectOption> getRecordTypes() {
list<SelectOption> options = new list<SelectOption>();
for (list<RecordType> rts : [SELECT ID, name FROM RecordType WHERE SObjectType = 'Interviewers_Feedback__c' ORDER BY name])
{
for (RecordType rt : rts) {
options.add(new SelectOption(rt.ID, rt.Name));
}
}
return options;
}
}