SelectionModel.selectedIndex change listener always returns old value as -1

XMLWordPrintable

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: P4
    • 8
    • Affects Version/s: fx2.0
    • Component/s: javafx

      Try using a callback such as the following, and observe that the old value is always -1

      listView.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
          public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
              System.out.println("change listener: " + t + " -> " + t1);
          }
      });

      Workaround: Developer can locally record the old value of the selected index within the ChangeListener anonymous inner class.

            Assignee:
            Jonathan Giles
            Reporter:
            Jonathan Giles
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: