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
Ron WildRon Wild 

Problems with pagination on custom object

I'm trying to set up a custom list controller to take advantage of the new build-in pagination capabilities in the new release, but the example provided in the docs doesn't appear to be working.

The sample code:

public class opportunityList2Con {
  public ApexPages.StandardSetController setCon {
  get {
    if(setCon == null) {
      setCon = new ApexPages.StandardSetController(Database.getQueryLocator([select
      name,closedate from Opportunity]));
    }
  return setCon;
  }
  set;
  }
}

<apex:page controller="opportunityList2Con">
  <apex:pageBlock >
    <apex:pageBlockTable value="{!setCon.records}" var="o">
      <apex:column value="{!o.name}"/>
      <apex:column value="{!o.closedate}"/>
    </apex:pageBlockTable>
  </apex:pageBlock>
</apex:page>


Produces a compiler error: "Unknown Property: 'SObject.name'"    My dev account is on NA6 so I do have the winter '09 release.

Has anyone succeeded in using the pagination feature with a custom list controller??

Thanks,
BoolsEyeBoolsEye
The documentation is wrong, you can find the answer here