Table rows hide/show, how to smartly update table??

Hi all,

I’m vaadin newbie, so be patient! :)! I’ve searched throughout the forum and the docs but I cannot solve my dilemma…

I’ve a set of data that I need to show in a table, but not all the data have to be shown at the same time.
Some row of the table have to be shown only if the user click on the “parent” row.

For Example

Initial table

11 | 12 | 13 |
21 | 22 | 23 |
31 | 32 | 33 |

the user click on row2

11 | 12 | 13 |
21 | 22 | 23 |
21a | 21b | 21c |
31 | 32 | 33 |

and when the user click again row2 the added row must disappear.

The problem I’m undergoing is that I cannot find a way to “smarly update the table”. I know how to mangane
event, my problem is only about the table…

I’m looking for a solution that allow me to hide/show rows without use the Container.addItem() method
every time. I tried Hierarchical, TreeContainer and Tree Table but no one seems to help me (I hope I mistake… :))

Any suggestion??

Thanks in advance for your time and your answers!


It seems that the TreeTable would achieve this. As you are already familiar with events. Then collapse or expand the child row as needed with the treeTable.setExapand(id,true/false) method. when the parent is clicked.

ehi thank you!! I got lost in the uncountable TreeTable method! :)!