You need to sign in to do that
Don't have an account?
Weird Behavior - Getting and Setting Query String Parameters on a Single Page
<apex:page standardController="Account">According to the tutorial, "
<apex:pageBlock title="Hello {!$User.FirstName}!">
You are displaying contacts from the {!account.name} account.
Click a contact's name to view his or her details.
</apex:pageBlock>
<apex:pageBlock title="Contacts">
<apex:form>
<apex:dataTable value="{!account.Contacts}" var="contact" cellPadding="4" border="1">
<apex:column>
<apex:commandLink>
{!contact.Name}
<apex:param name="cid" value="{!contact.id}"/>
</apex:commandLink>
</apex:column>
</apex:dataTable>
</apex:form>
</apex:pageBlock>
<apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="false" title="false"/>
</apex:page>
After saving this markup, refresh your browser with the id query string parameter but without the cid parameter in the URL. Initially the contact detail page is not rendered, but when you click a contact name the page renders the appropriate detail view."
However, refreshing the page using just the id query string parameter does render the Contact Detail page.
Also, in this case I have two contacts in the form section. Clicking on the other contact still renders the page with the first contact. I've copied this code into my page verbatim, and it's not working as advertised. I sent a message to the Developer's Guide writers with no response. Am I copying and pasting the code incorrectly, or is there a glitch in the example??
Thanks in advance
First, I talked to our documentation writer and he did already have a task to look at this, so it did not fall on deaf ears!
But second, here's a workaround page that uses a partial page update to just update the detail component. I think it is a better example of what you would actually want to do since it eliminates the need for a full page refresh. It will still show one of the contact detail section initially though.
Message Edited by jwetzler on 06-19-2008 05:38 PM