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

MultipleSelectionModel.getSelectedIndices returns a list of -1 if no items in list

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8
    • 7u10
    • javafx
    • Mac OS X 10.8.2, jdk 1.7.0_10, JavaFX 2.2.4b16

      Steps to reproduce:

      1. Create listview
      2. Add a listener to the listview.getSelectionModel().getSelectedIndices()
      3. Add an item to the list
      4. Remove the only item from the list

      The listener will be called but if you call listview.getSelectionModel().getSelectedIndices(), it returns a list of size 1 containing -1. I believe it should be an empty list.

      Related to this, a call to listview.getSelectionModel().getSelectedItems() returns a list of size 1 containing null. This shold be an empty list as well.

      All works as expected if the list contains more than one item after the removal.

            jgiles Jonathan Giles
            cstanford Curtis Stanford
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: