title: Why do I need to nest a component with rendered="#{some}" in another component when I want to ajax-update it?
body: <p>So I've found a few answers close to this, and I've found enough to fix the problem I had.  But even so, I'm curious as to understand the workings around this.  Let me illustrate with an example :</p>
  
  <p>I have a facelet <code>.xhtml</code> page that looks like this (shortned).</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;h:form id="resultForm"&gt;
  
      &lt;h:panelGroup class="search_form" layout="block"&gt;
          &lt;h:inputText id="lastname" value="#{search.lastname}"/&gt;
          &lt;h:commandButton action="#{search.find}" value="Find"&gt;
              &lt;f:ajax execute="lastname" render="resultDisplay"/&gt;
          &lt;/h:commandButton&gt;
      &lt;/h:panelGroup&gt;
  
      &lt;h:dataTable value="#{search.searchResults}" var="results" id="resultDisplay"
              rendered="#{!empty search.searchResults}"&gt;  
          &lt;h:column&gt;
              #{results.field}
          &lt;/h:column&gt;
      &lt;/h:dataTable&gt;
  
  &lt;/h:form&gt;
  </code></pre>
  
  <p>Now, for the sake of breivity, I will not post all the backing bean code, but I have something of this sort :</p>
  
  <pre class="lang-java prettyprint-override"><code>public void find() {
      searchResults = setResults(true);
  }
  </code></pre>
  
  <p>Where <code>searchResults</code> is an <code>ArrayList&lt;Objects&gt;</code>.  After a search, it is not null - checked in multiple tests (can be null, but not in the testing I am doing).</p>
  
  <p>Now.  This does NOT work.</p>
  
  <p>But if I nest the <code>dataTable</code> inside another, let's say <code>panelGroup</code>, it will work.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;h:panelGroup id="resultDisplay"&gt;
      &lt;h:dataTable value="#{search.searchResults}" var="results"
          rendered="#{!empty search.searchResults}"&gt;  
          &lt;h:column&gt;
              #{results.field}
          &lt;/h:column&gt;
      &lt;/h:dataTable&gt;
  &lt;/h:panelGroup&gt;
  </code></pre>
  
  <p>Now, this changes allows everything to work fine.  I'd be okay with this... but I guess I am seeking a bit of understanding as well.  Any insight as to why I have to nest these components?  I am surely missing something!</p>