title: JSF/Facelets/JSTL conditional display best practices
body: <pre><code>            &lt;ui:repeat  value="#{bean.allResults}" var="result"&gt;
                  &lt;ui:fragment rendered="#{result.condition1}"&gt;
                      &lt;ui:include src="/item1.xhtml"&gt;
                  &lt;/ui:fragment&gt;
                  &lt;ui:fragment rendered="#{result.condition2}"&gt;
                      &lt;ui:include src="/item2.xhtml"&gt;
                  &lt;/ui:fragment&gt;
                  &lt;ui:fragment rendered="#{result.condition3}"&gt;
                      &lt;ui:include src="/item3.xhtml"&gt;
                  &lt;/ui:fragment&gt;
                  &lt;ui:fragment rendered="#{result.condition4}"&gt;
                      &lt;ui:include src="/item4.xhtml"&gt;
                  &lt;/ui:fragment&gt;
              &lt;/ui:repeat&gt;
  </code></pre>
  
  <p>I have a couple of questions regarding best practices when using JSF/JSTL/Facelets<br>
  I have a JSF page that looks like the code above. Let's assume this loop returns 10 results and for each result only 1 condition evalutates to true. 
  So the user will see 10 results on the html page once it loads.</p>
  
  <ol>
  <li><p>Eventhough only 10 items will display in html the component tree will contain 40 items, it would contain those where rendered evaluated to false.
  Is the behavior described above accurate?</p></li>
  <li><p>If 1 is true and we could have lots of hidden components in the component tree is that a performance concern, let's say it was 400 items instead of 40?</p></li>
  <li><p>In Faceletes or JSF is there a conditional tag handler which behaves like the c:if and won't include the component in the tree? Or should I use c:if as a last resort? I'm trying to avoid using JSTL.</p></li>
  </ol>
  
  <p>Thanks.</p>