nikhilbchilwant / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
1 stars 1 forks source link

deselectRow in SelectionGrid fails to fire events #260

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Found in what component (Widget/FAQ/Library):
SelectionGrid (trunk/src/com/google/gwt/gen2/table/client/SelectionGrid.java)

Detailed description:
When deselecting a row, no event is fired even when selected rows has
changed. This is because the old row set is calculated after the row has
already been deselected.

Workaround if you have one:
Replace:
    Element rowElem = selectedRows.remove(new Integer(row));
    if (rowElem != null) {
      // Get the old list of selected rows
      Set<Row> oldRows = null;
      if (fireEvent) {
        oldRows = getSelectedRowsSet();
      }

With:
if (selectedRows.contains(row)) {
  // Get the old list of selected rows
  Set<Row> oldRows = null;
  if (fireEvent) {
    oldRows = getSelectedRowsSet();
  }
  Element rowElem = selectedRows.remove(row);

Or some equivalent.  

Original issue reported on code.google.com by igien...@gmail.com on 8 Apr 2009 at 11:15