I want to create a composite component to which you can pass the layout of repeating elements. 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 do not want to h:outputTextbe hardcoded in the component. When using the component, I try to do something like this:
<my:list var="user" value="#{myBean.userList}">
<h:outputText value="Test #{user.name}"/>
</my:list>
Suppose I need to use var, but I don’t know how to handle this in my component and get the child correctly <h:outputText value="Test #{user.name}"/>.
source
share