RFR: 8356770: TreeTableView not updated after removing a TreeItem with children and adding it to another parent

Ziad El Midaoui zelmidaoui at openjdk.org
Wed Nov 12 16:14:04 UTC 2025


On Wed, 12 Nov 2025 15:52:40 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

>> When a subtree is moved in a `TreeTableView` , the visuals don’t update until a resize or expand/collapse. The `TreeTableViewSkin` only rebuilds cells when the expanded row count changes.
>> This PR makes the skin to detect structural changes on `childrenModificationEvent` using new variable `treeStructureDirty`, and in `updateItemCount()` call `requestRebuildCells()` to refresh the visuals.
>
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TreeTableViewSkin.java line 151:
> 
>> 149:                     }
>> 150:                     else if (eventType.equals(TreeItem.<T>childrenModificationEvent())) {
>> 151:                         markItemCountDirty();
> 
> Question: Couldn't you just call `requestRebuildCells` directly here?

It works too , but makes the issue in JDK-8147483 reappear again which makes the test `test_jdk_8147483()` fail since it triggers extra full cell rebuilds. Here it only mark it and ask for layout in `updateItemCount()`

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1971#discussion_r2518929402


More information about the openjfx-dev mailing list