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 : https://github.com/vaadin/tree-grid.git
there may be a small mistake but I couldn’t found it. can anyone help me in this?

Add-on used: https://vaadin.com/directory/component/vaadin-treegrid/overview

<dependency>
   <groupId>com.vaadin</groupId>
   <artifactId>vaadin-treegrid</artifactId>
   <version>0.7.8</version>
</dependency>

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
18379122.java (3.06 KB)
18379125.java (4.51 KB)
18379128.java (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 (https://github.com/vaadin/tree-grid.git). 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.
18380179.java (3.87 KB)
18380182.java (1.43 KB)
18380185.java (2.94 KB)
18380188.java (1.25 KB)
18380191.java (1.59 KB)