I have a selectList
in my VF page which allows the user to select the record type. On change the appropriate fields are shown to the user by re-rendering the PageFields.
But as well as re-rendering the Pagefields outputPanel
I'd like to disable the selectList control (or even replace it with an outputField
or label.
<apex:outputPanel id="RecordTypeBlank" rendered="{!recordType == ''}" >
<div Id="RecordTypeQuestion">
<div style="font-weight: bold;">
Please select the record type before continuing
</div>
<table border="" style="width:100%;" >
<tr>
<td valign="middle" align="right" style="width:21%; padding-right: 3px;" >
<apex:outputLabel value="Type of Change:"/>
</td>
<td valign="middle" align="left" style="width:79%; padding-left: 4px;" >
<apex:selectList value="{!recordType}" size="1">
<apex:actionSupport event="onchange" rerender="PageFields" status="vfStatus"/>
<apex:selectOptions value="{!RecordTypes}"/>
</apex:selectList>
</td>
</tr>
</table>
</div>
</apex:outputPanel>
<apex:outputpanel id="PageFields" >
I tried changing the onchange
event of the selectList as below:
<apex:actionSupport event="onchange" rerender="PageFields RecordTypeBlank" status="vfStatus"/>
but that hasn't worked.
So how could I either disable the selectList, or dynamically replace it with an outputField showing the selected recordType (which is stored in the variable !recordType
in my controller.