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
Mike Lee 12Mike Lee 12 

Visualforce StandardList Controller pagination question - finding documentation on variables

Hello,

I am looking into adding pagination to a Visualforce page and have read a few articles about doing so. Most of these examples include logic that uses the following variables:
  • PageNumber
  • ResultSize
  • PageSize
  • HasPrevious
  • HasNext

I'm guessing these are member variables which have to do something with the StandardSetController class. I'm wondering if anyone can point me to any documentation about these variables?

Thanks,

Mike
Best Answer chosen by Mike Lee 12
Anthony KindAnthony Kind
This is probably what you are looking for.
https://developer.salesforce.com/docs/atlas.en-us.200.0.pages.meta/pages/pages_quick_start_controller_getter_methods.htm
---------
Excerpt:

One of the primary tasks for a Visualforce controller class is to give developers a way of displaying database and other computed values in page markup. Methods that enable this type of functionality are called getter methods, and are typically named getIdentifier, where Identifier is the name for the records or primitive values returned by the method.
For example, the following controller has a getter method for returning the name of the controller as a string:
view sourceprint?
1public class MyController {

3    public String getName() {
4        return 'MyController';
5    }

7}
To display the results of a getter method in a page, use the name of the getter method without the get prefix in an expression. For example, to display the result of the getName method in page markup, use {!name}:
1<apex:page controller="MyController">
2    <apex:pageBlock title="Hello {!$User.FirstName}!">
3        This is your new page for the {!name} controller.
4    </apex:pageBlock>
5</apex:page>

------------
The StandardSetController has a bunch of getter methods, like getPageNumber, getResultSize, etc.

https://developer.salesforce.com/docs/atlas.en-us.200.0.pages.meta/pages/apex_ApexPages_StandardSetController_methods.htm

As the first article explains, a Visualforce page can reference the result of these getter methods by referencing the name without the "get", with syntax similar to that used for referencing variables.

All Answers

Anthony KindAnthony Kind
This is probably what you are looking for.
https://developer.salesforce.com/docs/atlas.en-us.200.0.pages.meta/pages/pages_quick_start_controller_getter_methods.htm
---------
Excerpt:

One of the primary tasks for a Visualforce controller class is to give developers a way of displaying database and other computed values in page markup. Methods that enable this type of functionality are called getter methods, and are typically named getIdentifier, where Identifier is the name for the records or primitive values returned by the method.
For example, the following controller has a getter method for returning the name of the controller as a string:
view sourceprint?
1public class MyController {

3    public String getName() {
4        return 'MyController';
5    }

7}
To display the results of a getter method in a page, use the name of the getter method without the get prefix in an expression. For example, to display the result of the getName method in page markup, use {!name}:
1<apex:page controller="MyController">
2    <apex:pageBlock title="Hello {!$User.FirstName}!">
3        This is your new page for the {!name} controller.
4    </apex:pageBlock>
5</apex:page>

------------
The StandardSetController has a bunch of getter methods, like getPageNumber, getResultSize, etc.

https://developer.salesforce.com/docs/atlas.en-us.200.0.pages.meta/pages/apex_ApexPages_StandardSetController_methods.htm

As the first article explains, a Visualforce page can reference the result of these getter methods by referencing the name without the "get", with syntax similar to that used for referencing variables.
This was selected as the best answer
Mike Lee 12Mike Lee 12
Thanks for the reply and the links. After I read the documentation everything started to click in my head :)

Mike