Currently, templates can only be formulated for individual parts of a view (table, dialog, form). In addition, you want to create a complete view (table with dialog and form) for a specific model type in the layout editor, but later edit and configure the views created by the template individually.
Problem
If a template contains a config:template-call and this call is inlined, then there is no possibility to configure this component independently.
Instead, this config:template-call should become a layout-reference, so that the content can be configured separately.
Implementation
- A layout editor template(*.template.xml) can contain several other template calls(<config:template-call>). These config:template-call nodes are not expanded when components are created, but become independent components that can be further configured afterwards.
- It is possible to refer in the arguments of a template-call to the components created by another template-call. This is done by setting the attribute layout-scope to the template-call. This scope can be used in other places. Ex:
<config:template assistant-for="com.top_logic/layout.template.xml" > ... <config> <components> <config:template-call layout-scope="__tableTemplateScope__" template="com.top_logic/table.template.xml" /> <config:template-call template="com.top_logic.element/form.template.xml"> <arguments model="selection(__tableTemplateScope__#Table)"/> </config:template-call> </components> </config> </config:template>
Here the local scope __tableTemplateScope__ is set for the first component. In the second component can be referenced to thus the component "Table" from the template table.template.xml.
- The constant __enclosingLayoutScope__ was introduced to reference components from the actual template.
Test
TestTableWithDetailTemplate.script.xml