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

TreeView: Selection issue with Open/Close arrow

    Details

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

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: