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

TableViewSelectionModel: clearSelection(index) doesn't update selectedIndex

XMLWordPrintable

      here's a failing test (here simply copied from a bunch of selection-related tests in my github, just add to your own test - tableView with 5 items and everything in default state :-)

          @Test
          public void testClearSelectionAtIndex() {
              int index = 2;
              getSelectionModel().select(index);
              getSelectionModel().clearSelection(index);
              assertTrue("selection must be empty after unselect the selected",
                      getSelectionModel().isEmpty());
              assertFalse("index must be unselected", getSelectionModel().isSelected(index));
              assertEquals("index must be cleared",
                      -1, getSelectionModel().getSelectedIndex());
          }

      it fails (for both single and multiple selectionMode) at the last assert, somehow the selectedIndex property doesn't seem to get updated.

            jgiles Jonathan Giles
            fastegal Jeanette Winzenburg
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: