I tried to add a child element to treetable (element is a Bean) but the somehow the result is weird. I put a small example together.
BeanItemContainer<Project> bic = new BeanItemContainer<Project>(Project.class);
TreeTable projectTable = new TreeTable();
projectTable.setContainerDataSource(bic);
bic.addBean(Root);
bic.addBean(p1);
bic.addBean(p2);
bic.addBean(p3);
projectTable.setParent(p1, Root);
projectTable.setParent(p2, Root);
projectTable.setParent(p3, p1);
As you can see in the last line p1 should be parent of p3, and the result :see the pic. (p3 become the children of p2)
Code can be accessed from here : goo.gl/BMXiv
There are 2 main files:
TttestApplication.class
Project.class
Cs
Unfortunatelly, I could not get over the issue above, so I load beans by 'addProjectToTree' and everything happens as usually using addItem.
That's it.
Cs