major
minor
major
minor
minor
#26663
TreeGridComponent: Selection is not reset after discarding a transient row
Problem
A new row is automatically selected as a transient object. If the object creation is canceled, the new row is discarded. The problem is that the row is first discarded, and only then is the associated selection searched for and reset (GridComponent#dropRow()). However, the selection cannot be found at this point, which is why the row is removed but the selection remains.
If, in this state, you switch to edit mode and then exit it again, GridComponent#handleComponentModeChange() calls the dropRow(...) function with null because no row is found for the still-existing selection. This results in a NullPointerException.
If, on the other hand, an attempt is made to create a new object, the old “new object” is used as the context object, which also fails.
Solution
In the dropRow(...) method, first identify and mark the affected rows, then remove them. Afterward, the selection can be reset for the affected rows.
Test
- TestDropGridRow.script.xml or
- Manually:
- In an empty tree view (tl:GridComponent), create a new object as a new row.
- Expected Result: The new row is displayed and selected.
- Do not save; cancel immediately.
- The new row disappears. There is no visible selection.
- Switch to edit mode.
- There is still no visible selection.
- Exit edit mode / cancel.
- Expected behavior: No NullPointerException occurs.
- In an empty tree view (tl:GridComponent), create a new object as a new row.