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

TreeView: ContextMenu does not selects the TreeCell on which the menu has been started

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u20
    • 7u45, 8
    • javafx
    • The problem occurs in JavaFX bundled in JDK 7u51 and in JDK 8b129 (RC 2). Testes on Mac OS X and Windows.

      TreeView bug: When starting a ContextMenu on a TreeView cell by right clicking on the cell, then this cell must get selected. This works most of the time.
      But when there is already a ContextMenu visible for a cell and the user starts the context menu for another cell by right clicking on it, then the old ContextMenu closes and the new ContextMenu starts on the new cell. But the cell selection is stil on the old tree cell, the TreeView does not selects the cell the user clicked on.

      This is a problem for the user experience and the event handling. The user will invoke actions on cells which are not selected. And the event handlers are also processing the selected cell, which is the wrong one.

      I've attached a Java class for reproducing the problem. This is an example from the official Oracle tutorials. You just need to right click on a group cell and right click on another tree cell afterwards.

            jgiles Jonathan Giles
            ssaringjfx Stefan Saring (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: