function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
XactiumBenXactiumBen 

Problems with Disabled selectList and reRender

I have a selectList tag that is disabled (and also set to readonly) but when I click a command button that rerenders the selectList, suddenly the list is enabled!  Just wondering if there is something I have done wrong, or if it's an issue with visualforce.
Ron HessRon Hess
can you break this down to a sample of code ?
I can't tell by the description how you are enabling / disabling this element.

it should not do what you are describing, unless the disabled attribute is set by the controller, which somehow is returning an unexpected value.
XactiumBenXactiumBen

Code:
<apex:form >
<apex:pageBlock>
<!-- This one is fine -->
<apex:SelectList disabled="true" readonly="true" size="1">
<apex:selectOption itemValue="1" itemLabel="Test" />
<apex:selectOption itemValue="2" itemLabel="Second Value" />
</apex:SelectList>

<apex:pageBlockButtons >
<apex:commandButton value="Refresh" rerender="tableSummary" />
</apex:pageBlockButtons>

<apex:pageBlockTable id="tableSummary" value="{!summary}" var="s">
<apex:column>
<apex:facet name="header">Test Select 1</apex:facet>
<apex:SelectList disabled="true" readonly="true" size="1">
<apex:selectOption itemValue="1" itemLabel="Test" />
<apex:selectOption itemValue="2" itemLabel="Second Value" />
</apex:SelectList>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>

Sorry about that.  {!summary}  just gets a list of records from the controller.  Upon further experimentation it seems that when wrapped in a pageBlockTable, the selectList becomes broken somehow.
jwetzlerjwetzler
Doesn't have anything to do with pageBlockTable.  The list where you commented that "this one is fine" is fine because it's not being rerendered.

This doesn't work either:
Code:
<apex:form >
<apex:commandLink rerender="theList" value="click me"/>
    <apex:SelectList disabled="true" readonly="true" size="1" id="theList">
        <apex:selectOption itemValue="1" itemLabel="Test" />
        <apex:selectOption itemValue="2" itemLabel="Second Value" />
    </apex:SelectList>
</apex:form>

 I'm not sure at all why this is happening but I can log a bug for it.

sid_devsid_dev
Has this bug been fixed. I am having similar problem
balajibondarbalajibondar

I am also facing the same issue where we are not able to rerender <apex:selectlist based on button click.

It's working with <apex:outputpanel but we will not be able to maintain the SFDC css for <apex:selectlist