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

TreeView: Selection issue with Open/Close arrow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8
    • fx2.0
    • javafx

      I attach a test here, 3 listeners are added to the treeView: InvalidationListener, ListChangeListener and EventHandler<CLICKED>

      1) run the test
      2) select child-1-0
      3) click on the open/close arrow of child-1 to close the child-1
          Here are the listener traces:
                   ---jsl-InvalidationListener observable=[TreeItem [ value: child-1 ], TreeItem [ value: child-2 ]]
                   ---jsl-InvalidationListener getSelectedItems=[TreeItem [ value: child-1 ], TreeItem [ value: child-2 ]]
                   ---jsl-ListChangeListener getSelectedItems=[TreeItem [ value: child-1 ], TreeItem [ value: child-2 ]]
                   ---jsl-ListChangeListener c.getList()[TreeItem [ value: child-1 ], TreeItem [ value: child-2 ]]
          Question1:
                   why child-2 is in the selection list? but frome the stage the child-2 does not have the selection color
           Question2:
                   I called
                          treeView1.getSelectionModel().getSelectedItems()
                   in both InvalidationListener and ListChangeListener and got the same results, is it right?
      4) click on any key to print out the current selection:
                   ---jsl-EventHandler [TreeItem [ value: child-1 ]]
          now the selection list is correct.

            jgiles Jonathan Giles
            sjiang Shanliang Jiang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: