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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Due:
                Created:
                Updated:
                Resolved:
                Imported: