Tab View¶
The content of a detail view (sections, buckets/child lists, embedded tables and
charts, documents and the map) can be split across several tabs instead of being
shown on one long page. This is configured per node with tabView.
Details tab
The first tab, labeled Details, is created automatically. Any section,
bucket, table, chart or document that is not explicitly assigned to another
tab via entries is shown on this automatic Details tab. It is not itself
configurable and cannot be reordered. If all content is assigned to other
tabs, the Details tab is not shown at all.
Configuration¶
"root": {
"name": "asset",
...
"tabView": {
"position": "top",
"entries": [
{
"label": "Master data",
"icon": "icon-info",
"type": "section",
"names": ["id", "details"]
},
{
"label": "Work Orders",
"color": "color-blue",
"type": "child",
"names": ["workorder"]
},
{
"label": "Documents",
"type": "documents",
"names": ["doclinks"]
},
{
"type": "map"
}
]
}
}
| Property | Description | Default | |
|---|---|---|---|
tabView |
Enables the tab view for this node. | ||
position |
Position of the tab bar: top or bottom. |
top |
|
entries |
Array of tab entries, see below. Evaluated in the configured order. |
Entry types¶
type |
Assigns to the tab ... | Requires |
|---|---|---|
section |
... the given sections | names |
child |
... the given child node's entries (always behaves like a bucket, whether or not bucket is actually configured), embedded tables or charts |
names |
documents |
... the given document/file link configurations | names |
map |
... the map, if enabled for this node |
Child tabs always behave like buckets
Inside a tabView, a child node assigned to a child tab entry always
gets the same menu (sort/search/actions), badge count and lazy-loading
behavior as a configured bucket - whether
or not bucket is actually configured for that child. There is no need to
configure bucket just to get these features on a tab.
- If a tab ends up with exactly one such bucket, it is shown without its own card/header - the tab itself already provides that boundary - and its content is loaded automatically the first time the tab is opened.
- If a tab combines several child nodes, each one is still shown as its own expandable card, loaded on demand only once the user expands it, exactly like a normal bucket.
If bucket is configured anyway, note that
bucketCompact is always ignored on a
tab: the bucket is always shown as a regular, expanded card there, never as
a compact tile (unless it is the only content of the tab, see above).
Every entry additionally supports:
| Property | Description |
|---|---|
label |
Tab label. See label fallback if not set. |
icon |
Tab icon class. Can optionally be followed by a color-* class to color the icon itself (e.g. icon-star color-blue), independent of color. See icon fallback if not set. |
color |
CSS color class applied to the tab button (e.g. color-blue, see Color). |
visible |
Function (visible.js) to dynamically show/hide the tab. See Dynamic visibility. |
Content assigned to more than one tab
A section, bucket, table, chart or document must only be referenced by one tab entry. If a name matches multiple entries, only the first matching entry receives it and a warning is logged to the console. If an entry references content that does not exist at all, the tab is hidden and an error is logged.
Label and icon fallback¶
If label/icon are not configured on the entry, they are resolved in this order:
- For
childtabs: the label/icon of the first matched bucket, otherwise the referenced child node'slabel/icon. - For
documentstabs: the current node'slabel/icon, otherwise the fallback label isFilesand the fallback icon isicon-file-image. - For
maptabs:Mapas label and theicon-mapicon. - Otherwise:
Tab {index}and theicon-new-tabicon.
Badges¶
Tabs can show a count badge next to the label:
childtabs: total number of links across all matched buckets and the total number of rows of a table. Not shown if the tab contains only an embedded chart.documentstabs: total number of downloadable documents.sectionandmaptabs never show a count badge.
Validation across tabs¶
Attributes keep their validation independent of which tab they are displayed on:
- A tab shows an error badge with the number of currently invalid attributes it contains (sections, inline-edit list entries and embedded table rows).
- When there is at least one invalid tab, a summary error bar is displayed above the tab bar. Clicking it jumps to the next tab with an error.
- If Save fails validation, the view automatically switches to a tab that contains an error, unless the currently active tab already has one.
- This also respects attributes that only became invalid through another
attribute's
validation.js(cross-attribute validation), even if the attribute itself has no validator of its own.
Dynamic visibility¶
Each entry can be hidden dynamically with visible, evaluated the same way as
other config functions,
receiving the current record (object) and userData. If the function throws
an error, the tab is hidden and the error is logged to the console.
Persisted tab selection¶
The last selected tab is remembered and restored the next time the same record type is opened. If the previously
selected tab is no longer visible (e.g. hidden by visible), the view falls
back to the Details tab.