DataGrid / CellTable: ValueChangeEvent from CheckBoxCell in a custom built header

122 views
Skip to first unread message

Alex opn

unread,
Dec 28, 2012, 8:18:00 AM12/28/12
to google-we...@googlegroups.com
Hello folks,

I've encountered a problem with a CheckBoxCell in a custom built header for a DataGrid.

What I've done is adapting the CwCustomDataGrid-example to my needs and adding a "Check all"-column in the header. I'm using the CheckboxColumn implementation from the accepted answer from here: ->> StackOverflow

This is how I add the valueChangeHandler to the column in the constructor of my CustomHeaderBuilder:
checkboxHeader.addValueChangeHandler(new ValueChangeHandler<Boolean>() { // TODO: Fix, does not work :-/
                @Override
                public void onValueChange(ValueChangeEvent<Boolean> event) {
                    final boolean selected = event.getValue();
                    ...
                }
            });

I've also tried several other places to register the handler before and after the construction of the CustomHeaderBuilder without any effect.

The strange thing is that the CheckBoxColumn works flawlessly when not using a custom built header. But the problem is that the column is not propagating any events when used in combination with an AbstractHeaderOrFooterBuilder.

I debugged a lot already and can confirm that the handler gets registered correctly and the column-instance used is definitely the same all the time.

Anyone has an idea what could prevent events from Cells / Columns in custom built headers / footers?

Thanks
Alex

Alex opn

unread,
Dec 28, 2012, 9:38:17 AM12/28/12
to google-we...@googlegroups.com
CheckBoxColumn should be  CheckboxHeader! Sorry for the confusion!
Reply all
Reply to author
Forward
0 new messages