I have a h:dataTable
retrieving a list of objects. For each of those objects I have to display some object information (obj.x
, obj.y
) but also a list of children linked to that obj
.
I coded a function to retrieve the children. This function looks like this :
public List<ChildModel> getChildren(ObjectModel obj) {
List<ChildModel> children = //...
return children;
}
Since a want to display the children on a single line I thought about using a loop :
<h:dataTable value="objectList" var="obj">
...
<c:forEach items="#{someBean.getChildren(obj)" var="child" >
...
</c:forEach>
</h:dataTable>
But I get a java.lang.NullPointerException
. When switching to a h:dataTable
(like this) everything works fine :
<h:dataTable value="objectList" var="obj">
...
<h:dataTable value="#{someBean.getChildren(obj)" var="child" >
...
</h:dataTable>
</h:dataTable>
I also tried with a ui:repeat
but I think (maybe wrongly) that it is not possible.
What I am missing?