java - GWT: SelectionChangeEvent.Handler does not detect deselect of row on CellTable -
so have piece of code same on gwt showcase
selectionmodel = new singleselectionmodel<t>(keyprovider); celltable.setselectionmodel(selectionmodel); selectionmodel.addselectionchangehandler(new selectionchangeevent.handler() { public void onselectionchange(selectionchangeevent event) { selectedrow = ((singleselectionmodel<t>).selectionmodel) .getselectedobject(); }); column<t, boolean> checkcolumn = new column<t, boolean>(new checkboxcell(true, false)) { @override public boolean getvalue(t object) { return celltable.getselectionmodel().isselected(object); } }; celltable.addcolumn(checkcolumn, safehtmlutils.fromsafeconstant("<br/>"));
the problem is, when uncheck checkbox selectionchangeevent doesn't handle it. instance onselectionchange being called, when select record, deselecting record doesn't invoke method.
any help?
you forgot add defaultselectioneventmanager guess.
change line
celltable.setselectionmodel(selectionmodel);
to
celltable.setselectionmodel(selectionmodel, defaultselectioneventmanager.<t> createcheckboxmanager());
Comments
Post a Comment