Skip to main content

Layouts

Layouts define the UI structure of a class — which fields, relations, actions, and navigations are shown, and in what order. Each layout has a type that determines where it is used.

Definition

{
"class": "my-project.employmentAgreement",
"type": "OBJECT_DASHBOARD",
"labelKey": "LABEL:contractDetails",
"tabPage": false,
"items": [...]
}
PropertyTypeDescription
classTypeFQNThe class this layout applies to.
namestringIdentifier for named layout variants (selected via ?name=xxx).
labelKeystringTranslation key for the layout tab title. See Label keys.
typeLayoutTypeDetermines where this layout is rendered.
itemsLayoutItem[]Ordered list of items to display.
tabPagebooleanWhen true, this layout is rendered as a tab; when false (default), as the main section.

Layout types

TypeDescription
OBJECT_DASHBOARDMain detail view for a single object. Usually has a main section and optional tab layouts for related objects.
RELATED_OBJECTCompact inline detail panel when an object appears as a related item.
OBJECT_FORM_DASHBOARDInline creation form for a new object.
GENERAL_DASHBOARDDashboard not tied to a specific object (e.g. a home or search screen). Supports named variants via name.
CLASS_DASHBOARDList/table overview for all objects of a class.
NAVIGATION_PANEItems shown in the sidebar navigation. Usually contains NAVIGATE items.

Label keys

Labels used in layout items (headers, tabs, button captions, static text) are resolved via LabelKey strings. The format is TYPE:name, for example LABEL:contractDetails or DATA_CLASS_PLURAL:commons.document.

Type prefixResolves to
LABEL:keyA general translation key from generalLabels in the class translation.
DATA_CLASS_SINGULAR:fqnSingular name of the named class.
DATA_CLASS_PLURAL:fqnPlural name of the named class.
VALUE_TYPE_LABEL:fieldLabel for the named value type field.
LIST_VALUE:list:keyLabel for a standard list item.
PLAIN_TEXT:textLiteral text, no lookup performed.
BLANKEmpty string.

Strings without a recognized prefix are treated as PLAIN_TEXT. Inline HTML is also supported.

Layout items

Each item in items has a type field that determines its structure. When type is omitted, FIELD is assumed.


FIELD

Displays a value type field.

{ "name": "jobTitle" }
{ "type": "FIELD", "name": "salary", "header": true }
PropertyDescription
nameThe value type name to display.
headerWhen true, renders this field as the main title of the panel.
defaultValuePre-filled value when creating a new object.

A section heading.

{ "type": "HEADER", "label": "Employment details" }
PropertyDescription
labelThe heading text, a LabelKey string, or inline HTML.

ACTION

A button that triggers a script, opens a report, or deletes the current object.

{ "type": "ACTION", "name": "sendInvitation", "label": "Send invitation", "actionType": "SCRIPT" }
{ "type": "ACTION", "name": "invoicePDF", "label": "Print invoice", "actionType": "REPORT" }
{ "type": "ACTION", "label": "Delete", "actionType": "REMOVE" }
PropertyDescription
nameThe script or report name to invoke. Not required for REMOVE.
labelButton caption or LabelKey string.
actionTypeWhat happens when the button is clicked. Defaults to SCRIPT when omitted.

actionType values:

ValueDescription
SCRIPTInvokes the named script on the current object. Default when actionType is omitted.
REPORTOpens the named report for the current object in a new browser tab. See Reports.
REMOVEDeletes the current object. name is ignored.

A navigation link to another class or screen.

{
"type": "NAVIGATE",
"class": "my-project.invoice",
"navigationType": "CLASS_DASHBOARD",
"icon": "receipt"
}
PropertyDescription
classThe class to navigate to.
navigationTypeWhich page to open. See NavigationType below.
iconOptional icon identifier.
nameSelects a named general dashboard when navigationType is DASHBOARD.

NavigationType values:

ValueDescription
CLASS_DASHBOARDOpens the list/table page for the target class.
OBJECT_FORM_DASHBOARDOpens an inline creation form for the target class.
DASHBOARDOpens a general dashboard, optionally named via name.

RELATION

An editable relation field.

{ "type": "RELATION", "relatedClass": "commons.company", "editBehavior": "SEARCH" }
PropertyDescription
relatedClassThe class of the related object.
editBehaviorUI widget for selecting objects: SEARCH (free-text), DROPDOWN, or CHECKBOX (for multiple with few options).

Displays a related object as an inline sub-panel.

{ "type": "RELATED_OBJECT", "relatedClass": "commons.person", "name": "compact" }
PropertyDescription
relatedClassThe class of the related object.
nameSelects a named layout variant on the related class (omit for default).

Displays a filtered list of related objects, typically as a tab.

{
"type": "RELATED_VIEW",
"fromClass": "my-project.project",
"relatedClass": "my-project.task",
"showTitle": true
}
PropertyDescription
fromClassThe class the relation originates from (the current object's class).
relatedClassThe class of the related objects to list.
filterClassWhen set, restricts the list to this subtype of relatedClass.
showTitleWhether to show a section heading.
nameNamed view on relatedClass to use (omit for default).

An embedded search widget for a class.

{ "type": "SEARCH", "class": "commons.person", "showTitle": true }
PropertyDescription
classThe class to search within.
showTitleWhether to show a section heading.

TEXT

A static text block.

{ "type": "TEXT", "label": "This section shows employment history." }
PropertyDescription
labelText content, a LabelKey string, or inline HTML.

VIEW

Embeds a named or default View for a class.

{ "type": "VIEW", "class": "my-project.task", "name": "openTasks", "showTitle": true }
PropertyDescription
classThe class whose view is rendered.
nameThe named view to embed (omit for the default view).
showTitleWhether to show a section heading.

Example: OBJECT_DASHBOARD layout

{
"class": "my-project.employmentAgreement",
"type": "OBJECT_DASHBOARD",
"items": [
{ "type": "HEADER", "label": "Contract details" },
{ "type": "FIELD", "name": "contractType" },
{ "type": "FIELD", "name": "salary" },
{ "type": "FIELD", "name": "hoursPerWeek" },
{ "type": "HEADER", "label": "Parties" },
{ "type": "RELATION", "relatedClass": "commons.company", "editBehavior": "SEARCH" },
{ "type": "RELATION", "relatedClass": "commons.employee", "editBehavior": "SEARCH" },
{ "type": "HEADER", "label": "Actions" },
{ "type": "ACTION", "name": "extractFromDocument", "label": "Extract from document" }
]
}

Example: OBJECT_DASHBOARD with a tab

A main section layout and a separate tab for related tasks on the same class:

[
{
"class": "my-project.project",
"type": "OBJECT_DASHBOARD",
"tabPage": false,
"items": [
{ "type": "FIELD", "name": "projectName", "header": true },
{ "type": "FIELD", "name": "startDate" },
{ "type": "FIELD", "name": "status" }
]
},
{
"class": "my-project.project",
"type": "OBJECT_DASHBOARD",
"tabPage": true,
"labelKey": "DATA_CLASS_PLURAL:my-project.task",
"items": [
{
"type": "RELATED_VIEW",
"fromClass": "my-project.project",
"relatedClass": "my-project.task",
"showTitle": false
}
]
}
]