I'm loading the data in the dropdownlist as shown below and when the user select from dropdownlist Select I'm showing simple pageblockSection with the div but instead I'm getting this error
Invalid id: Select
Markup
<apex:pageBlockSection rendered="{!selectedRecordTypeId = 'Select'}" >
<div>Please select record type</div>
</apex:pageBlockSection>
<apex:pageBlockSection title="Select Record Type" columns="1">
<apex:selectList id="countries" value="{!selectedRecordTypeId}" size="1" required="true">
<apex:selectOptions value="{!RecordTypes}"/>
</apex:selectList>
</apex:pageBlockSection>
Apex
public string selectedRecordTypeId {get;set;}
public List<selectOption> getRecordTypes()
{
List<selectOption> rTypes = new List<selectOption>();
String objectAPIName = 'Case' ; //any object api
Schema.DescribeSObjectResult sobjectResult = Schema.getGlobalDescribe().get(objectAPIName).getDescribe();
List<Schema.RecordTypeInfo> recordTypeInfo = sobjectResult.getRecordTypeInfos();
Map<String,Id> mapofCaseRecordTypeNameandId = new Map<String,Id>();
for(Schema.RecordTypeInfo info : recordTypeInfo)
{
mapofCaseRecordTypeNameandId.put(info.getName(),info.getRecordTypeId());
rTypes.add(new SelectOption(info.getRecordTypeId(), info.getName()));
}
rTypes.add(new SelectOption('Select','Select')); //<<<added
return rTypes;
}
selectedRecordTypeId = 'Select'should beselectedRecordTypeId == 'Select'. – Adrian Larson Mar 05 '16 at 04:14