enhancement
major
minor
major
minor
major
#29635
TL Views: a <tree> renders every node as a link, so a click on the label navigates away instead of just selecting the node
A <tree> in a .view.xml renders its nodes through the default node content, MetaResourceControlProvider, which builds a ReactResourceCellControl with the link switched on. A node whose type has a target in the DisplayTargetService is therefore an <a>: a click on the label selects the node and sends the goto command, which navigates to the display target and leaves the tree. Only a click on the empty remainder of the row selects without navigating.
A tree is normally a selection source - its selection channel drives a detail view beside it - so the node label must select on a click and nothing else. Opening the object is what <on-activate> (double-click, Enter) is for.
There is no declarative way around it: nodeContent takes any ReactControlProvider, but the only implementation is the singleton MetaResourceControlProvider, which has no configuration. An application that wants plain labels has to write a Java provider class.
Reproduce in tl-demo-react: Demos → Tree Demo. Click the label of a node: the app navigates to the object's display target instead of only selecting the node.
Lösung
- MetaResourceControlProvider becomes a configured class (PolymorphicConfiguration) with the options image, label and link of ReactResourceCellControl, so it can be configured wherever a ReactControlProvider is asked for. All three are on by default: the display of an object leads to the place the application shows the object at, which is the general meaning of such a display.
- <tree> gets a specialized configuration subtype of the provider as the item default of nodeContent, which overrides only the default of link with off: a node is the object's own place in the view, a click on it selects it, and opening the object is what <on-activate> is for. A tree whose nodes should lead to the object configures the provider explicitly (<nodeContent class="com.top_logic.layout.react.controlprovider.MetaResourceControlProvider"/>), which is the general display and links.
- Tables are not affected: a reference value in a table cell is rendered by the select display control, which keeps its link.