Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9215445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:12:23+00:00 2026-06-18T02:12:23+00:00

I implemented pagination on my visual force page looking at these two resources. http://hisrinu.wordpress.com/2012/01/09/pagination-using-standardsetcontroller/

  • 0

I implemented pagination on my visual force page looking at these two resources.
http://hisrinu.wordpress.com/2012/01/09/pagination-using-standardsetcontroller/
http://blog.jeffdouglas.com/2009/07/14/visualforce-page-with-pagination/

My visualforce page accepts date parameters and runs a search on custom object records and displays them in an Apex:datatable.

Here is my controller code. This works fine until I begin click the next, previous links continuously for about a minute and then it begins to slow down and freeze up.

Any idea why this is happening?

UPDATE: 7/28: This is happening only in IE. I have IE 9.

    public with sharing class FundingReportController { 

  // the soql without the order and limit
  private String soql {get;set;}

  Public Integer size{get;set;}
  Public Integer noOfRecords{get; set;} 


  //export to excel - returns a page reference to the AccountDataExcel page
    public PageReference exportToExcel() {
      return Page.fundingreportExcel;
    }

    //Instantiate the StandardSetController
    public ApexPages.StandardSetController con{get; set;}






   public List<Money_Transaction__c> moneyTransactions
    {
        get
        {
            if(con != null)
                return (List<Money_Transaction__c>)con.getRecords();
            else
                return null ;
        }
        set;
    }  


 // returns a list of wrapper objects for the sObjects in the current page set
    public List<Money_Transaction__c> getMoneyTransactions() {
    try{
        //moneyTransactions = new List<MoneyTransactionWrapper>();
        moneyTransactions = new List<Money_Transaction__c>();
        for (Money_Transaction__c mt: (List<Money_Transaction__c>)con.getRecords()) 
         {              
            moneyTransactions.add(mt); 
         }       

        }
          catch (Exception e) 
            {
               ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Code Error '+e));
            }
        return moneyTransactions ;
    }

  // the current sort direction. defaults to asc
  public String sortDir {
    get  { if (sortDir == null) {  sortDir = 'asc'; } return sortDir;  }
    set;
  }

  // the current field to sort by. defaults to last name
  public String sortField {
    get  { if (sortField == null) {sortField = 'Settlement_Date_First__c'; } return sortField;  }
    set;
  }

  // format the soql for display on the visualforce page
  public String debugSoql {
    //get { return soql + ' order by ' + sortField + ' ' + sortDir + ' limit 20'; }
    get { return soql + ' ' + sortDir; }
    set;
  }

  // init the controller and display some sample data when the page loads
  public FundingReportController() {

    moneyTransactions = new List<Money_Transaction__c>();
    //Default dates: 6 months before today
    Date fromDate = date.today();
    fromDate = fromDate.addMonths(-6);
    String fromDateStr = String.ValueOf(fromDate);
    //ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,fromDateStr   ));
    //Default dates: Today
    Date toDate = date.today();    
    String toDateStr = String.ValueOf(toDate);




     soql = 'select ACH_Type__c, Settlement_Date_First__c, Total_ACH_Amount__c,Settlement__r.id,Settlement__r.name,Money_Movement_Type__c,Bank_Name__c,Bank_Account_Number__c,Tax_Batch__c,Payroll_Group_Detail__c from Money_Transaction__c where Settlement_Date_First__c <= '+ toDateStr + ' AND Settlement_Date_First__c >= ' + fromDateStr + ' AND ACH_Type__c != \'VHR DDP Disbursement\'';


     runQuery();
  }

  // toggles the sorting of query from asc<-->desc
  public void toggleSort() {
  //ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Inside Toggle'+soql + sortField +sortDir ));
    // simply toggle the direction
    sortDir = sortDir.equals('asc') ? 'desc' : 'asc';
    // run the query again
    runQuery();
  }

  // runs the actual query
  public void runQuery() {

    try {


          size=10;  

          ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Inside New Run query + StandardSetController '+soql + ' order by ' + sortField + ' ' + sortDir));
          con = new ApexPages.StandardSetController(Database.getQueryLocator(soql + ' order by ' + sortField + ' ' + sortDir + ' limit 100'));
          // sets the number of records in each page set
          con.setPageSize(size);
          noOfRecords = con.getResultSize();       



    } catch (Exception e) {
      ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops! SOQL error '+soql ));
    }

  }

  // runs the search with parameters passed via Javascript
  public PageReference runSearch() {

    String fromDate = Apexpages.currentPage().getParameters().get('fromDate');
    String toDate = Apexpages.currentPage().getParameters().get('toDate');




    soql = 'select ACH_Type__c, Settlement_Date_First__c, Total_ACH_Amount__c,Settlement__r.id,Settlement__r.name,Money_Movement_Type__c,Bank_Name__c,Bank_Account_Number__c,Tax_Batch__c,Payroll_Group_Detail__c from Money_Transaction__c where Settlement_Date_First__c <= '+ toDate + ' AND Settlement_Date_First__c >= ' + fromDate + ' AND ACH_Type__c != \'VHR DDP Disbursement\'';
    con = new ApexPages.StandardSetController(Database.getQueryLocator(soql)); 


    // run the query again
    runQuery();

    return null;
  }


    // indicates whether there are more records after the current page set.
    public Boolean hasNext {
        get {
            return con.getHasNext();

        }
        set;
    }

    // indicates whether there are more records before the current page set.
    public Boolean hasPrevious {
        get {
            return con.getHasPrevious();
        }
        set;
    }

    // returns the page number of the current page set
    public Integer pageNumber {
        get {
            return con.getPageNumber();
        }
        set;
    }

    // returns the first page of records
    public void first() { 

        try{
        con.first();  


        }
        catch (Exception e) 
            {
               ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Code Error '+e));
            }

    }

    // returns the last page of records
    public void last() {   

        try{
        con.last();        

        }
        catch (Exception e) 
            {
               ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Code Error '+e));
            }
    }

    // returns the previous page of records
    public void previous() {   

         try{
            con.previous();      

            }
            catch (Exception e) 
            {
               ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Code Error '+e));
            }
        }

    // returns the next page of records
    public void next() {  
    try{   

        con.next();      

        }
         catch (Exception e) 
            {
               ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Code Error '+e));
            }

    }       




}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:12:24+00:00Added an answer on June 18, 2026 at 2:12 am

    This project was stalled for some months. I returned to it and this time I used SOQL with the new OFFSET feature and got rid of the standardcontroller.

    The actual issue was IE9 itself and I have posted the details and the solution here.
    I hope it helps someone with the same re-rendering issues with IE9 and Visualforce.

    Thanks.

    https://salesforce.stackexchange.com/questions/7917/visualforce-major-grief-with-ie9-ajax-refresh-rerender-issues

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've followed the pagination tutorial from http://framework.zend.com/manual/en/zend.paginator.usage.html I have successfully implemented pagination for my
I've have already implemented pagination using the following code: public Paginacao<Anuncio> consultarPaginado(int pagina, Integer
I have already implemented some AJAX pagination in my Rails app by using the
i've implemented this pagination class for search.php page in a separate file called class.pagination.php
I have implemented LazyLoading for datatable. When I run through datatable by using pagination
I'm doing QA on this new app I've created using CI. With pagination implemented,
I am trying to implement Pagination in JSF using Tomahawk. When the page is
I have implemented pagination using the will_paginate plugin. I want have a drop down
I have just implemented custom pagination by overriding the -(BOOL)knowsPageRange: and -(NSRect)rectForPage: methods. These
I have implemented pagination to my data, but the problem is I only have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.