You need to sign in to do that
Don't have an account?
newbiewvfdev
<apex:detail /> tag not working as specified in the developers guide
Hi there,
I am trying to follow the example in the developers guide on page 21.
<apex:page standardController="Account">
<apex:pageblock title="Hello {!$User.FirstName}">
You are viewing the {!account.name} account.
</apex:pageblock>
<apex:detail />
</apex:page>
I dont' see the detail section. I only see the pageBlock section. What am I missing?
All Answers
Did you supply an id to it? If there's no record to display it won't show anything.
You can either visit your page with ?id=001xxx (replace 001xxx with the id of an account record) or you can specify a subject attribute on apex:detail with the id of the account you want to display.
Yes, I know about that. I am passing in the id. If I specify the subject attribute it works. But I am wondering why it's not working if I dont' specify it. On the documentation it says it should show it.
First I've heard of this not working and I can't reproduce it myself. I feel like I must be missing something. You're using the exact code you pasted originally right? With standardController="account"?
If you're using that exact code and URL then please log a case.
Thanks stephan and Jill,
That was a good catch indeed. But it's strange that it was able to access the account name using Id(Capital) but not the rest of the data. By the way, is there a way to show just one of the relatedList through the detail tag?
I know there is a component called relatedList. But for some reason when I try using that for Campaign it doesn't work. Thanks.
This does not work:
<apex:page standardcontroller="Campaign"> <apex:relatedList list="CampaignMembers"/> </apex:page>