enhancement
There is said to be a selection model for trees in which selecting a node ensures that all nodes in the subtree are selected; when a node is selected, all nodes in that subtree are deselected.
A node that is not a leaf node is selected if and only if all nodes in the subtree are selected. Such a selection model makes sense for trees in which only leaf nodes are actually relevant for selection. Internal nodes are merely groupings whose selection has no business-related significance in and of itself.
Implementation
- A new selection model, ` TreeSelectionModel `, is introduced, which implements the semantics described above.
- The logic can be used in In-App by adding an additional column with the column configuration "Tree Selection Column" in the configuration for tree tables or tree grids.
- In this column, for a node that has both selected and unselected children, the selection box displays “undefined.”
Code Migration
- Overrides of `LayoutComponent.channels() ` must be changed to overrides of ` LayoutComponent.programmaticChannels() `.
- The class `com.top_logic.element.layout.grid.GridComponent$DefaultMultiSelectionModelFactory ` has been deprecated. Instead of referencing this class, you can simply set the option ` multiple="true" `.
Replace this
{{{
<selectionModelFactory class="com.top_logic.element.layout.grid.GridComponent$DefaultMultiSelectionModelFactory"/>
}}}
with this
{{{
<selectionModelFactory multiple="true"/>
}}}
Test
- The demo includes examples:
- Technical Demo > Components > Tables and Trees > Tree Table with Tree Selection
- Technical Demo > Components > Tables and Trees > Tree Grid with Tree Selection
- TestTreeSelectionModel