I am re-rendering a PageBlock ("DisplaySection") which contains a table which contains an OutputPanel. When I load "DisplaySection" directly from the controller, the OutputPanel renders as expected. When "DisplaySection" is rendered after clicking the CommandButton, the OutputPanel does not render, meaning the "subs1" records are not displayed.

The odd part is that when I remove the OutputPanel (despite setting rendered to "true" -- done for testing), the "subs1" section displays as expected when rendered from the button refresh. Why does that OutputPanel not render when "DisplaySection" is not rendered from the initial page load?

I have stripped down the sample code but it contains all the structures as my real page.

The OutputPanel is set to rendered=true for testing purposes and to demostrate that it's not code in the controller that is messing anything up.

The "DisplaySection" renders properly in every case (initial page load and after the button is clicked) but the OutputPanel does not load/render after the button is clicked.

<apex:form id="MainForm">

    <apex:pageBlock id="MainSection">

        <apex:pageBlock id="InputSection" rendered="{!displayInputSection}">
            <apex:inputText value="{!recordId}"/> <br/>
            <apex:commandButton value="Inspect" action="{!inspectButton}" rerender="MainSection"/>

        <apex:pageBlock id="DisplaySection" rendered="{!displayDisplaySection}">

            <apex:repeat value="{!fieldHolderList}" var="fh">


            <apex:repeat value="{!fh.subFields}" var="subs1">
                <apex:outputPanel rendered="true">

1 Answer 1


Rendered is not reevaluated when directly rerendering the element. You need to rerender the parent element.

If the element is not rendered initially a rerender on that element will not work

Since you are rerendering the MainForm the next possible check is to make sure that displayDisplaySection is updated to true in your controller on the button click

Since your apex code is not shown it is hard to tell but it is likely that the value is not updated to true


Add layout=none to your outputpanel

The following is an example. Remove the layout=none to reproduce your issue, add it back to see it fixed


<apex:page id="myExamplePage" controller="myExampleController">

        <apex:commandButton action="{!changeMe}" reRender="outside" value="Click me"/>
        <apex:outputpanel layout="block" id="outside">

                <tr><td>MY VALUE</td></tr>

                <apex:repeat value="{!tmp}" var="v">
                    <apex:outputPanel layout="none" rendered="{!dorender}">






public class myExampleController {

    public String[] tmp {get;set;}
    public boolean dorender {get;set;}
    public myExampleController(){
        tmp = New String[]{'A','B','C'};
        dorender = true;

    public void changeMe(){


There are some other issues with repeat and rerendering parent elements but that was not the case here

  • I am rerendering MainSection which contains "DisplaySection". "DisplaySection" renders properly via the button click but the output panel (direct child of "DisplaySection") does not.
    – Haphazard
    Jun 29, 2017 at 19:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .