Vaadin7 : TreeGrid is not showing child elements

Problem: I’m trying to use the TreeGrid component in my vaadin 7 application. but, it is not showing child elements.
it is considering all the records as parent and showing it like normal grid.

I’ve followed the way of coding explained here :
there may be a small mistake but I couldn’t found it. can anyone help me in this?

Add-on used:


I’ve attached a screenshot of how Treegrid is showing data. I was expecting output like:

S001           parent1
 -I001         child1 
 -I002         child2

I hope this is enough information to know what is the problem? if not then please let me know.

Thank you

18379119.png (3.06 KB) (4.51 KB) (490 Bytes)

It has been a while when I have played with this last time, but to me it looks like you have not implemented hasChildren in your Container, and hence TreeGrid is not able to determine whether a row is a leaf or not, i.e. does not render hierarchy.

Thank you Tatu Lund for the quick reply. I tried what you suggested. and some more changes similar to the DemoContainer ( But, facing the same problem.

Please check the attached file. I’ve removed some unwanted things from the old code. I hope this code is more easier to understand. (3.87 KB) (1.43 KB) (2.94 KB) (1.25 KB) (1.59 KB)