Skip to content

Composition collections in runtime detail view template#5334

Open
knstvk wants to merge 1 commit into
masterfrom
view-template-collections
Open

Composition collections in runtime detail view template#5334
knstvk wants to merge 1 commit into
masterfrom
view-template-collections

Conversation

@knstvk
Copy link
Copy Markdown
Contributor

@knstvk knstvk commented May 31, 2026

Motivation

Runtime view templates (#5225) generate list/detail views from @DetailViewTemplate metadata, but had a known limitation: composition collections were unsupported — a generated detail view only rendered single-value fields, with no way to view or edit a composition's child rows.

What it does

When a @DetailViewTemplate entity has composition *-to-many properties, the generated detail view now renders a TabSheet:

  • the first General tab holds the form of single-value fields;
  • each composition collection gets its own tab with a dataGrid (create / edit / remove). Create/edit open the line entity's own detail view in a dialog, so line entities are expected to also carry @DetailViewTemplate.

Entities without composition collections render a plain formLayout exactly as before.

Implementation

  • ViewTemplateHelper#getCollectionProperties — returns composition *-to-many properties (associations and datatype collections excluded), honoring excludeProperties.
  • detail-template.ftl — adds a fetch-plan entry and a nested <collection> container per composition property, and a conditional <tabSheet>; collection-tab dataGrids use list_create/list_edit/list_remove with openMode=DIALOG.
  • Hidden back-reference — the inverse attribute of a composition collection (the child's parent reference) is excluded by default in both the master's columns and the line entity's own detail form (restorable via includeProperties).
  • Localized labels — tab labels are emitted as msg:// references so captions resolve per-user at view-load time (the "General" tab uses a new viewTemplate.generalTab key).

Generate a TabSheet in template-based detail views for entities that have
composition *-to-many properties: the first "General" tab holds the form of
single-value fields, and each composition collection gets a tab with a dataGrid
(create/edit/remove via standard list actions that open the line entity's own
detail view). Entities without composition collections render a plain formLayout
as before.
@knstvk knstvk linked an issue May 31, 2026 that may be closed by this pull request
@knstvk knstvk marked this pull request as ready for review May 31, 2026 09:21
@knstvk knstvk requested a review from glebfox May 31, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runtime view templates

1 participant