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>
<apex:pageBlock id="DisplaySection" rendered="{!displayDisplaySection}">
<div>
<table>
<tr><th>--</th><th>--</th></tr>
<apex:repeat value="{!fieldHolderList}" var="fh">
<tr><td>{!fh.fn}</td><td>{!fh.ft}</td>
<apex:repeat value="{!fh.subFields}" var="subs1">
<apex:outputPanel rendered="true">
<tr><td>({!subs1.fd})</td><td>{!subs1.fn}</td></tr>
</apex:outputPanel>
....