Detail
#28354
Value suggestions, tree options via TLScript: Context object is not transferred in the creation context
A reference is defined at a class A for which value suggestions are to be displayed as a tree selection. The annotation "Value suggestions / tree options via TLScript" is used.
The tree nodes are to be filtered according to the concrete type of the context object. The "Children" function receives 2 arguments for this: The tree node and the context object.
Problem
In the creation context (creation dialog, object creation), the context object is not transferred and no value suggestions can be calculated. When editing an instance that has already been created, however, it works and the value suggestions are calculated correctly.
This affects all functions of this annotation: "Root node", "Children", "Selection filter" and most probably also "Parents": The context object is only transferred correctly in the editing context, but not in the creation context.
Note
In the variant "Value suggestions via expression" as a list, however, it works: Here, the context object is the only argument of the function and is also passed correctly in the creation context / can also be evaluated in the creation context.
Test
- /com.top_logic.demo/src/test/java/test/com/top_logic/demo/scripted/model/attribute/TestOptionProviderForPrimitiveTypes.script.xml
- Field Strs in Technical Demo > Components > Selection options