Search code examples
javagwtgwt-celltable

GWT CheckBoxCell : how to add a change handler?


I am using the code from http://gwt.google.com/samples/Showcase/Showcase.html#!CwCellTable to insert a checkbox column in a celltable.

I would like to render a button (outside the table) only if some lines are selected, but i don't see how i can add the eventHandler.

I tried to use a field updater, but it doesn't work :

FieldUpdater<Bean, Boolean> checkFU = new FieldUpdater<Bean, Boolean>() {
    @Override
    public void update(int index, Bean object, Boolean value) {
        addSelectionButton.setVisible(!selectionModel.getSelectedSet().isEmpty());
    }
};

Any idea or documentation ?

Thanks


Solution

  • Oh yeah ! I found it !

    MultiSelectionModel.addSelectionChangeHandler() 
    

    And it works great !