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

[TreeTableView]: cell.getItem() value is wrong after dynamically adding new treeItems to the treeTable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8
    • 8
    • javafx

      I have a TreeTable, with some cells have a context menu for adding children treeItems.
      The second column of my TreeTable is a String column, with a cell factory that returns a TextFieldTreeTableCell.

      I right-click on some item, and choose "Add value", a new child TreeItem is created dynamically. I double-click on the second column of the newly created treeItem in order to start editing.

      I add a breakpoint in the code of TextFieldTreeTableCell.startEdit() method, and I watch for the value of cell.getItem().
      I notice that cell.getItem() contains the wrong value . In fact, it contains the value of the cell of another TreeItem that is below it in the tree.

      It seems like when adding items dynamically (after the TreeTable has been created), the cells are not properly "shifting" their items' values.

      I am not sure if I explain well, I will add the scenario's code in a separate comment. If you follow the above sample, and add a breakpoint in startEdit(), you will see the problem.

            jgiles Jonathan Giles
            rashajfx rasha (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: