Checbox in Table Header


I have GeneratedColumn which contains Checkbox on my Table.
Is there any way to put the checkbox on column header, which will provide behavior to select/deselect all checkboxes?
Or, should I use icon instead of Checkbox on column header ?

btw, I’ve seen ticket about “Table Header Click Handler” on, which is will be available on Vaadin 6.4.
For now (in Vaadin 6.3), how could I implement table header click handler? Do I have to override sort() method ?

Thanks in advance…

Check out

Hi John…

thanks for the reply.
But that thread doesn’t give me a clue: how to put checkbox on the column header ?
Is it possible, or I have to use icon ?



Unfortunately you cannot add a checkbox (or any component for that matter) to the header.
So, you probably have to resort to using an icon instead.

Note that version 6.4 will contain several improvements to the Table, and adding components into headers is probably one of the new features. 6.4 is due in about two months.

If you really need to use 6.3, in addition of using an icon you could probably use AbsoluteLayout. Place the checkbox and table in the layout and position the checkbox above the column header. Be minded though, that this solution is a bit hackish and untested.

Might I know the feature is supported by 6.4 or not? If yes, where to find the document or samples?

While several table improvements made it to 6.4, this one didn’t.

I am using vaadin 6.7.5, is there any example for generating a check box in the header pls.

Thank you.

Team Vaadin we are using Vaadin 7.1.7 but we couldn’t find this feature yet. Why is it such a hard thing? Astonished to see this tiny stuff is pending over four years.

It is a very hard thing to implement, partly because of the long history of the Table (which actually originally dates back long before the times of AJAX) and accumulated complexity there from features added over time, numerous browser issues to work around etc. Furthermore, hacking together something that puts checkbox in a header and committing it to the framework would just make things worse for maintenance - instead, a clean and automatically tested support for arbitrary components in headers would make much more sense.

I’d expect this feature to first land in the new Grid component rather than in the old Table, which does not get many new features anymore.