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
Shree KShree K 

what are the differences between implementing pagination with standardSetController and StandardListController?

Hi All,
Can somone please explain the differences between implementing pagination with standardSetController and StandardListController? in another words when is it ideal to use a list controller and a set controller to implement pagination, Pros and cons for each? all i need is few points because i get to see the code and examples of implementing pagination in both ways and have a clear understading of implementing pagination using list controller but my interest is to about the differences between both ways.

My humble request to not post the blogspots online, I have been there already and couldn't find the differences.

Thanks,
Shree
Best Answer chosen by Shree K
Raj VakatiRaj Vakati
In case of standardSetController 



The maximum record limit for StandardSetController is 10,000 records. Instantiating StandardSetController using a query locator returning more than 10,000 records causes a LimitException to be thrown. However, instantiating StandardSetController with a list of more than 10,000 records doesn’t throw an exception, and instead truncates the records to the limit.

In case of StandardListController 

The recordSetVar attribute not only indicates that the page uses a list controller, it can indicates the variable name of the record collection. This variable can be used to access data in the record collection . recordSetVar  collect the data from the recently viewed list view

 

All Answers

Raj VakatiRaj Vakati
In case of standardSetController 



The maximum record limit for StandardSetController is 10,000 records. Instantiating StandardSetController using a query locator returning more than 10,000 records causes a LimitException to be thrown. However, instantiating StandardSetController with a list of more than 10,000 records doesn’t throw an exception, and instead truncates the records to the limit.

In case of StandardListController 

The recordSetVar attribute not only indicates that the page uses a list controller, it can indicates the variable name of the record collection. This variable can be used to access data in the record collection . recordSetVar  collect the data from the recently viewed list view

 
This was selected as the best answer
Shree KShree K
Hi Raj,
Could you please clear me with this part of your explanation?

"Instantiating StandardSetController using a query locator returning more than 10,000 records causes a LimitException to be thrown. However, instantiating StandardSetController with a list of more than 10,000 records doesn’t throw an exception"

In one instance Query locator can be used, which leads to exception.
other instance also has SetController instantiation with the list (but here, what exactly is helping to avoiding the exception?)
I mean how the list is working here, are we querying to get the list ?