I have a problem using a <ui: repeat>
inside another <ui: repeat>
. Let's see the code to explain it better:
<h:form>
<ui:repeat value="#{myManagedBean.listDocsFather}" var="dad">
<p:commandLink update="myPanel" process="@this" >
<f:setPropertyActionListener target="#{myManagedBean.doc}" value="#{dad.docId}" />
<div>
<h:outputLabel value="Document #{dad.docId.name} " />
</div>
</p:commandLink>
<!--here I execute a method to find the father's children's documents-->
<ui:repeat value="#{myManagedBean.listDocsSons(dad.id)}" var="child">
<p:commandLink update="myPanel" process="@this" >
<f:setPropertyActionListener target="#{myManagedBean.doc}" value="#{child.docId}" />
<div>
<h:outputLabel value="Document child #{childs.docId.name} " />
</div>
</p:commandLink>
</ui:repeat>
</ui:repeat>
<h:panelGroup id="myPanel" >
<!--if docId not null see my document-->
</h:panelGroup>
</h:form>
My problem is that many times my listDocsSons method is executed, even though the parent only has a record, that I am doing wrong or how could find the children documents, it is important to clarify that this code works nevertheless presents performance problems when running so many times the same method for a parent. Help me please !! I'm new to JSF.