Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Select all children's checkboxes in a TreeTable
Hello. I have a generated column with a checkbox in a TreeTable. How can I automatically select all children's checkboxes when I select parent's checkbox?
Any help is appreciated.
Thank you.
You can use getChildren() to get the collection of children's item IDs, over which you can iterate. I don't think you can access the generated checkboxes through the TreeTable's API. I'll assume that the checkboxes are not generated from the container properties. You could store references to them in a HashMap<Object,CheckBox> by using the item ID as the key; add the CheckBox references there in the column generator and remove them in a DetachListener added to each CheckBox.