JTable.clearSelection() does not clear lastModelSelection in SortManager

XMLWordPrintable

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: P4
    • None
    • Affects Version/s: 6
    • Component/s: client-libs

      FULL PRODUCT VERSION :
      java version "1.6.0_07"
      Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
      Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      OpenSuSE 10.3

      A DESCRIPTION OF THE PROBLEM :
      A call on JTable.clearSelection() should also clear the cached value lastModelSelection in JTable.SortManager, if a RowSorter is used.

      Otherwise, if you call:
      JTable.clearSelection();
      ...Sorter.setRowFilter(...) or ...Sorter.sort()

      the Selection will be restored.
      My Workaround is:
      JTable.clearSelection();
      TableModel.fireTableRowsUpdated(0,0);
      because this will update lastModelSelection;


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      I couldnt reproduce this in a small Demo Program.

      But a Debug-Session in my Application gave the in Description written results.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      JTable.clearSelection();
      TableModel.fireTableRowsUpdated(0,0);

            Assignee:
            Alexander Potochkin (Inactive)
            Reporter:
            Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: