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
Mike @ BlackTabMike @ BlackTab 

Issue reRendering <apex:detail> related lists

I have a VF page that contains a few apex:commandlinks with an apex:param that passes a record id to an apex:detail component. 

 

The Problem: When I click the command link the top portion of the apex:detail component reRenders fine, but in order to refresh the related lists, you have to click the command button again. 

 

Here is a sample of the code:

 

<apex:commandLink style="color:red" action="{!changePreview}" value="{!gchildren.Name}" reRender="preview">
<apex:param name="currentRecord" assignTo="{!currentRecord}" value="{!gchildren.Id}"/>
</apex:commandLink>

 

<apex:outputpanel rendered="{!showPreview}" id="preview" style="float:left; margin-left:10px; width:850px; padding: 5px; border:#1797C0 5px solid; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px;" >
    <h1 style="font-size: 20px; color:red;">{!IF(currentRecord == null, "Select A Record To Preview", "")}</h1>
    <apex:detail subject="{!currentRecord}" title="false" inlineEdit="true" relatedListHover="false" showChatter="false" />
</apex:outputpanel>

 The changePreview() method is of type PageReference, and simply returns a null value