Friday, December 28, 2012

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

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

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/_mcGo8Y4dHUJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment