<ui:repeat value="#{bean.allResults}" var="result">
<ui:fragment rendered="#{result.condition1}">
<ui:include src="/item1.xhtml">
</ui:fragment>
<ui:fragment rendered="#{result.condition2}">
<ui:include src="/item2.xhtml">
</ui:fragment>
<ui:fragment rendered="#{result.condition3}">
<ui:include src="/item3.xhtml">
</ui:fragment>
<ui:fragment rendered="#{result.condition4}">
<ui:include src="/item4.xhtml">
</ui:fragment>
</ui:repeat>
I have a couple of questions regarding best practices when using JSF/JSTL/Facelets
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.
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?
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?
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.
Thanks.