0

I am want to use list view filter to change the list of account in my visualforce page. I am not sure which event to use in action support. Here is what i have done so far

<apex:page standardController="Account" recordSetVar="accList" >
<apex:form>
<apex:pageBlock title="Accounts" id="accList" >
    Filter:
    <apex:selectList value="{!filterId}" multiselect="false" size="1" >
        <apex:selectOptions value="{!listViewOptions}" >
        <apex:actionSupport event="onchange" reRender="accList" />    
    </apex:selectOptions>
    </apex:selectList>
    <apex:pageBlockSection >
        <apex:pageBlockTable value="{!accList}" var="acc" >
            <apex:column value="{!acc.name}"/>
            <apex:column value="{!acc.accountNumber}"/>
            <apex:column value="{!acc.industry}"/>
            <apex:column value="{!acc.no_of_contacts__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
0

What I was doing wrong was I wrote the action support tag inside the select option tag.

<apex:selectList value="{!filterId}" multiselect="false" size="1" >
    <apex:selectOptions value="{!listViewOptions}" >
        <apex:actionSupport event="onchange" reRender="accList" />    
    </apex:selectOptions>
</apex:selectList>

Correct way is this

<apex:selectList value="{!filterId}" multiselect="false" size="1" >
    <apex:selectOptions value="{!listViewOptions}"/>
    <apex:actionSupport event="onchange" reRender="accList" />    
</apex:selectList>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.