Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6727200

JTable.clearSelection() does not clear lastModelSelection in SortManager

    Details

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

      Description

      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);

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: