+ Start a Discussion
learning1.3953795511514497E12learning1.3953795511514497E12 

standardSetController pagination is not working for setter

Hi I have a requiment where I need to use standardSetController to have 10,000 records in a table with pagination and the ckeckboxes.
I have refered the following sites.
http://blog.jeffdouglas.com/2009/07/14/visualforce-page-with-pagination/
http://blog.cloudclickware.com/tag/standardsetcontroller/

both work absolutely fine when I use getter method to get the values of lists used in pageblcock table.
e.g :
1 :In first link
<apex:pageBlockTable title="Contacts" value="{!contacts}" var="c">
 public List<CCWRowItem> getContacts()
{
      ---
}

2: In second link

<apex:pageBlockTable value="{!categories}" var="c">
public List<categoryWrapper> getCategories()
{
   ---
}

My requirement is quite different.
I need to set the value of list in the command buttonsa action method as shown below

VF Page
 -  - -
 - - -
<apex:commandButton action="{!DisplayTable}" value="Display Table" />
- - -
<apex:pageBlockTable value="{!tempContactList}" var="c">
   // columns
</apex:pageBlockTable>

partial Controller
- - -
-  - -

 public class WrapperClass

    {
        public Boolean isSelected {get; set;}
        public string conId {get; set;}
        public Temporary_Contact__c tempcon{get; set;}                
        
        public MassCreationOfContactsWrapper(Temporary_Contact__c tc)
        {            
            this.tempcon = tc;
            this.isSelected = false;
            this.conId = tc.id;
        }
    }
- -  -
 public ApexPages.StandardSetController setCon
    {
        get{
            if(setCon == null){
                size = 1000;
                string queryString = 'SELECT id,Name,First_Name__c,Last_Name__c,Email__c,Desk_Group__c from Temporary_Contact__c Where Email__c like  \'%@'+ emailDomain +'%\'  LIMIT 10000';                
                setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
                setCon.setPageSize(size);
                noOfRecords = setCon.getResultSize();
            }
            return setCon;
        }set;
    } 
- - -
public void DisplayTable()
{
       tempContactList = new List<wrapperClss>();     
        for(Temporary_Contact__c tc : (List<Temporary_Contact__c>)setCon.getRecords())
        {
            tempContactList.add(new wrapperClss(tc));
        }
}


When I do this my table is not refreshing after clicking on pagination buttons
Please help
Thanks,