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
BRupholdtBRupholdt 

Rerender confusion

I've followed a tutorial to use apex:outputPanel with apex:detail to refresh the detail based on user click.  I'm trying to do the same with a pageBlockTable now without success.  When I include both pieces on the page, the detail refreshes but the other data is not drawn.  Obviously I'm ding it wrong.
 
I am new to VisualForce and honestly don't know enough to ask the right questions.  Any help you can give would be great.
 
Here's my page code:
 
Code:
<apex:commandLink rerender="detail">{!user.Alias}</apex:commandLink>

<apex:outputPanel id="detail">
  //works
  <apex:detail subject="{!$CurrentPage.parameters.uid}" relatedList="false" title="false"/>
  //doesn't work for refresh - does work when output alone
  <apex:pageBlock>
    <apex:pageBlockTable value="{!Goals}" var="goal">
      <apex:column >
        <apex:facet name="header">Reference</apex:facet>
          {!goal.Name}
        </apex:column>
      <apex:column >
        <apex:facet name="header">Goal</apex:facet>
        <apex:outputLink value="/{!goal.id}" >{!goal.Goal__c}</apex:outputLink>
      </apex:column>
      <apex:column >
        <apex:facet name="header">Target Date</apex:facet>
        <apex:outputField value="{!goal.Target_Date__c}"/>
      </apex:column>
      </apex:pageBlockTable>
  </apex:pageBlock>
</apex:outputPanel>

 
BRupholdtBRupholdt
Perhaps I should say what I'm trying to accomplish.  I have a custom object names Goals__c which contains a simple list of goals for each staff member.  I want to make a page showing the users at the top as clickable links (or a view-like select) to display their goals below.  I can show the list for all users or the current user.  I can pass params to refresh the entire page and see the appropriate list.  I can't seem to figure out how to refresh just the goal lost area while staying on the same page.
 
Bob
TehNrdTehNrd
Refreshing components can be a little finicky at times. You may want to try re-rendering components individually like this.

Code:
<apex:commandLink rerender="detail,table">{!user.Alias}</apex:commandLink>

<apex:outputPanel id="detail">
<apex:detail subject="{!$CurrentPage.parameters.uid}" relatedList="false" title="false"/>
</apex:outputPanel>

<apex:pageBlock>
<apex:pageBlockTable value="{!Goals}" var="goal" id="table">
<apex:column >
<apex:facet name="header">Reference</apex:facet>
{!goal.Name}
</apex:column>
<apex:column >
<apex:facet name="header">Goal</apex:facet>
<apex:outputLink value="/{!goal.id}" >{!goal.Goal__c}</apex:outputLink>
</apex:column>
<apex:column >
<apex:facet name="header">Target Date</apex:facet>
<apex:outputField value="{!goal.Target_Date__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>


 

BRupholdtBRupholdt
Thank you for the help.  While it turned out I'd made a simple error in my query that caused the data not to display, separating the two render sections made nicer code.  I hadn't realized it could be done that way. 
 
Bob