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
BoolsEyeBoolsEye 

ApexPages.StandardSetController example from Winter 09 Developers Guide not working ?

I tried to create the ApexPages.StandardSetController example from the Winter 09 Apex Developers Guide in our Pre-Release environment.
 
I create the controller and the page as displayed below. The controller is ok but when I try to save the page I get the error:
 
Error: Unknown property 'SObject.name' 
 
I first tried this with a custom object and got the same error, can anyone confirm this.
 
Is there a cast missing somewhere ?
 
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;
}
}

 
Code:
<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>

 
Sam.arjSam.arj
 Have you signed for it though? Are you using the winter 09 instance? cause it is tricky.

You should sign up for it first:
 http://wiki.apexdevnet.com/index.php/Winter_09

BoolsEyeBoolsEye
Yes, I am using the Winter 09 Pre-Release instance and it is not working.
Ron WildRon Wild
The documentation is out-of-date ... see this post
LumingLuming
setCon is a property in your Apexclass. You may need create a method getsetCon().
 
Luming  
Ron WildRon Wild
The notation:

... setCon {get;set;} 

 will work in in place of separate getter and setter declarations.