+ 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: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" />

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