enhancement
major
minor
major
minor
defect
(User-visible)
minor
#26699
Collapsing the selection changes the selection in TreeGrids
If a node in a tree is collapsed and that node contains a selected node in its subtree, the behavior varies depending on the type of tree component.
- The tl:TreeComponent is configurable and uses a flag to determine whether the selection should be adjusted in this case—for example, by the first visible and valid parent node—or whether the selection should be retained as is.
- The `tl:TreeTableComponent` and `TreeGrid` adjust the selection as already explained in 1.
It would be desirable to offer a configuration option for all components, allowing the user to decide whether the component should adjust the selection when it is collapsed or not.
Code Migration
In layout XML files exported to the development environment, the ` selectCollapsed ` attribute must be changed to ` adjustSelectionWhenCollapsing ` when using the following templates:
- com.top_logic/tileTree.template.xml
- com.top_logic/tileTreetable.template.xml
- com.top_logic/tree.template.xml
- com.top_logic/treetable.template.xml
- com.top_logic.element/treegrid.template.xml
#!patch
@@ -6,21 +6,21 @@
template="com.top_logic/tree.template.xml"
>
<arguments
defaultSelection="true"
expandRoot="true"
expandSelected="true"
isSecurityMaster="false"
model=""
partnerGroup=""
rootVisible="true"
- selectCollapsed="false"
+ adjustSelectionWhenCollapsing="false"
showOnlySelectableNodes="false"
>
<name key="dynamic.2f6a4cc9-28a2-4bc0-b38a-c10d19aedcfc">
<en>Demo Types</en>
<de>Demo Types</de>
</name>
<modelBuilder class="com.top_logic.model.search.providers.TreeModelByExpression"
children="node->$node.get(`tl.element:StructuredElementContainer#children`)"
finite="true"
leafPredicate="false"
Test
src/test/java/test/com/top_logic/demo/scripted/layout/inapp/TestCollapsedSelection.script.xml