I want to create a composite component where to acutal layout of of iterating elements can be passed to the composite. This is a simplified example and works:
<composite:interface>
<composite:attribute name="value"/>
</composite:interface>
<composite:implementation>
<ul>
<c:forEach var="i" items="#{cc.attrs.value}">
<li>
<h:outputText value="Test #{i.name}"/>
</li>
</c:forEach>
</ul>
But I don't want the h:outputText
to be hardcoded in the component. When using the component I'm trying to have something like this:
<my:list var="user" value="#{myBean.userList}">
<h:outputText value="Test #{user.name}"/>
</my:list>
Is assume that I have to use a var
, but I don't know how to handle this in my component and access the child <h:outputText value="Test #{user.name}"/>
correctly.
var="item"
hardcoded. – Bicollateral