2

In a GWT celltable I have many rows associated with CheckboxCell.I need to know only the values of the selected checkboxes on a particular event.

user889244
  • 21
  • 1
  • 4

1 Answers1

1

you need to use SingleSelectionModel or MultiSelectionModel with ProvidesKey implementation (to return unique keys)

SelectionModel selectionModel = new MuliSelectionModel<T>(new ProvidesKey><T>() {
    @Override
    public Object getKey(T item) {
        // return unique key here
    }
});

then you assign it to celltable

table.setSelectionModel(selectionModel);

then you can simply invoke selectionModel.getSelectecSet() and it will return Set of objects which are selected in table.

Set<T> selectedObjects = selectionModel.getSelectedSet();

HTH

jdevelop
  • 12,176
  • 10
  • 56
  • 112