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
AthiAthi 

How ReRender AllAccounts in VF Page?

Hi all,
I am new to VF coding ...I would like to Rerender AllAccounts in a Account. Idea is to change all account owner by using custom button.  I have Controller extension which query all account. But I could rerender the list from controller extension. How do i do that? thanks in advance

VF page invoked by custom list button:
<apex:page standardController="Account"
    recordSetVar="Accounts"
    extensions="AccountSelectAllRec"
   showHeader="false"
    id="muopp"
>
    <apex:form id="muform">
                <apex:pageBlock title="Account Owner Mass-Update" mode="edit" id="mub1">
            <apex:pageMessages />
            <apex:pageBlockSection id="mus1">
                <apex:inputField value="{!Account.Ownerid}" id="stagename">
                    <apex:actionSupport event="onchange" rerender="{!AccountSelectAllRec}"/>
                </apex:inputField>
            </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom" id="mubut">
                <apex:commandButton value="Save" action="{!save}" id="butsav"/>
                <apex:commandButton value="Cancel" action="{!cancel}" id="butcan"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>
I dont want to select account. I have to update all account respecting user security. I wrote controller extension to query all account.
My controller extension.
 
public with sharing class AccountSelectAllRec {
private final Account acct; 
    // The constructor passes in the standard controller defined

    // in the markup below

    public AccountSelectAllRec(ApexPages.StandardSetController controller) {

        this.acct = (Account)controller.getRecord();

    }   
    public ApexPages.StandardSetController accountRecords {

        get {

            if(accountRecords == null) {
                           accountRecords = new ApexPages.StandardSetController(

                    Database.getQueryLocator([SELECT OwnerId FROM Account ]));

            }
            return accountRecords;

        }

        private set;
    }
    public List<Account> getAccountSelectAllRec() {
         return (List<Account>) accountRecords.getRecords();
    } 
}


When I change the code  rerender="{muselectedlist}"  to rerender="{!AccountSelectAllRec}" Code fails. Please helppppppppp......