Howzit Joshua,
I just want to understand the problem a little before I start to look into this. So you want to display something in a dataTable or panel grid.
One thing you didn't mention in your desc above, is how many rows this should render as, ie:
Let's use your first example, tree has a root, with 3 children. I understand that you want to columns, but how many rows should that render over? 4, or 3, 1...
IE:
A
B
C
D
OR
A B
C
D
OR
A B, C, D
Also, tomahawks tree component renders a tree in the view. DataTable knows how to render a Collection and renders as an html table.
So to me, your bean would contain let's say a Collection items that hold a Collection of themselves. Something like this.
so the problem comes in here is that there is no limit to how deep the children go, we could be trying to represent the family tree from the begining of time, or just from my grand father. So how would one represent this using a datatable?
<h
ataTable value="#{myBean.familyTree}" var="elem"...etc>
<h
utputText value="#{elem.name}"/>
<h
ataTable value="#{elem.children}" var="child1" ...>
<h
utputText value="#{child1.name}"/>
<h
ataTable value="#{child1.children}" var="child2" ...>
..... etc etc, depending on how many levels you want.
</h
ataTable
</h
ataTable>
</h
ataTable>
I don't know if this will work even, but am trying to express the idea. Can you see that you would basically have to hard the number of levels. If you're using dataTable. But on the udder hand, if you actually try to render this as a tree, it knows how to traverse the object graph, and will render correctly on the client side.
But I hear what you're saying, why can a table, not render a tree component., or why can a tree component not be rendered as a table, as opposed to a tree component rendering as "a-helluva-lot-of-tables,-with-a-helluva-lot-of-javascript-doing-funky-stuff-that-only-those-who-code-for-tomahawk-know-about" component.
It's almost like you want to use a recursive dataTable.