I'm trying to build a recursive composite component. But somehow I can't get the recursion to stop. Meaning I get an StackOverflowException.
I have looked at that question: https://stackoverflow.com/questions/17923220/
But I'm missing a thing. I have a tree like structure, where a node can zero to n children.
<cc:interface componentType="elementContainer">
<cc:attribute name="model"
type="de.foobar.Element"
required="true" />
</cc:interface>
<cc:implementation>
<p:panelGrid columns="6">
<c:if test="#{not empty cc.attrs.model.children}">
<c:forEach var="element"
items="#{cc.attrs.model.children}">
<ic:ElementContainer model="#{element}" />
</c:forEach>
</c:if>
</p:panelGrid>
</cc:implementation>
Even without the c:if
shouln't stop the recursion when the items attribute evaluates to an empty list?