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
CaffeineCaffeine 

apex:detail simple example doesn't work

I've tried the following code in 2 different orgs and it doesn't work:

<apex:page standardController="Account">
 <apex:pageBlock title="My Title">
     <b>Hello {!$User.FirstName}</b>
 </apex:pageBlock>   
  <apex:detail rendered="true"/>
</apex:page>


The "Hello username" works just fine, but the detail part of the page never shows.

I've even stripped it down to basics:

<apex:page standardController="Account">
   <apex:detail rendered="true"/>
</apex:page>

Nothing appears in this case.  The example is taken nearly verbatim from the VF Developer Guide.  What gives?

Thanks.
jwetzlerjwetzler
have you passed in an id so that the detail component has something to display?  Add a query param to your URL such as /apex/myPage?id=<account id goes here>.  Likewise you can set the subject attribute of your detail component, but since you're using the standard controller it makes more sense to pass it as a query param.
CaffeineCaffeine
Jill,
Thanks.  That worked.  The VF Tutorial on developer.salesforce.com appears to need an update.   See: http://wiki.apexdevnet.com/index.php/Force.com_Tutorial:_An_Introduction_to_Visualforce  (section 4)

Thanks again.