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

[TreeView] Removing an unselected TreeItem with selected descendents from a TreeView leaves null items in the selection model.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 9
    • 8u11
    • javafx
    • Mac OS X 10.9.4, JDK 8u11.

      It's possible the solution to this is included in RT-33612, targeted for Java 9. In which case I'll just wait for that, since I have decent workaround, but a bit less than ideal.

      If a single, selected TreeItem is removed from the model of a TreeView, the selection model detects that and removes the TreeItem from the selection. (I'm seeing evidence it may select the parent of the removed node instead...not sure if that's correct or incorrect behavior.) However, if a branch of the tree is replaced (or just removed), by replacing a (non-selected) node that contains one or more selected descendents, the selection model is left with some null items as shown by MultipleSelectionModel.getSelectedItems().

      Let me know if you don't already have a favorite test bed that can demonstrate this, and I'll distill a test class from my fairly complex use case.

            jgiles Jonathan Giles
            djansenjfx Dave Jansen (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: