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
ThomasmThomasm 

Apex Select List not working

I am using the select list to use different views.  It is supposed to refresh when i change the view but currently nothing happends

here is what i have so far

<apex:page standardController="Jobs__c" recordSetVar="jbs" sidebar="false">

    <apex:form >
     <apex:pageBlock title="Current Jobs">
             <apex:SelectList value="{!filterID}" size="1">
            
            <apex:actionSupport event="onchange" reRender="List"/>
            <apex:selectOptions value="{!listviewoptions}"/>
        </apex:SelectList>

<apex:pageBlockSection >
         <apex:pageBlockTable Value="{!jbs}" var="a" id="List">
             
             <apex:column >
        <apex:outputlink value="/{!a.id}">{!a.name} </apex:outputlink>
            </apex:column>

             
             <apex:column headerValue="Active" >
                 <apex:inputField value="{!a.Active__c}"/>
             </apex:column>
             <apex:Column value="{!a.Job_Number__c}"/>
     </apex:pageBlockTable>
     </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
    
   
</apex:page>
Best Answer chosen by Thomasm
Neetu_BansalNeetu_Bansal
Hi Thomasm,

While reRendering it is always prefer to reRender the parent block, so use the below code:
<apex:page standardController="Jobs__c" recordSetVar="jbs" sidebar="false">
	<apex:form>
		<apex:pageBlock title="Current Jobs">
            <apex:SelectList value="{!filterID}" size="1">
				<apex:actionSupport event="onchange" reRender="pbSection"/>
				<apex:selectOptions value="{!listviewoptions}"/>
			</apex:SelectList>

			<apex:pageBlockSection id="pbSection">
				<apex:pageBlockTable Value="{!jbs}" var="a" >
					<apex:column >
						<apex:outputlink value="/{!a.id}">{!a.name} </apex:outputlink>
					</apex:column>
					<apex:column headerValue="Active" >
						<apex:inputField value="{!a.Active__c}"/>
					</apex:column>
					<apex:Column value="{!a.Job_Number__c}"/>
				</apex:pageBlockTable>
			</apex:pageBlockSection>
		</apex:pageBlock>
    </apex:form>
</apex:page>
Let me know, if you need any other information.

Thanks,
Neetu