DataContextV2 object and injects it via Vue’s provide/inject mechanism so every component in the tree can access it as ctx.
Context Variables
Binding expressions receive actx object with the following properties:
| Variable | Type | Description |
|---|---|---|
ctx.dataObjects | any[] | All data objects in the current scope |
ctx.$item | any | Current item when inside a for loop |
ctx.$index | number | Current index when inside a for loop |
ctx.$parent | DataContextV2 | Parent data context (for nested scopes such as groupTaxon) |
ctx.$root | DataContextV2 | Root data context, always the top-level context |
ctx.tagMetadataMap | Map<string, any> | Taxonomy metadata definitions keyed by tag path |
ctx.formValues | Record<string, string> | Shared record for cross-field value exchange |
Props vs Bindings
EveryUINode can set values on its component through two mechanisms:
- props — static values set at definition time. They do not change unless the form definition itself changes.
- bindings — JavaScript expressions evaluated against
ctxat render time. They re-evaluate automatically whenever the underlying data context changes.
props and bindings define the same key, the binding result takes precedence.
Tag Metadata
Components such asv2:attributeEditor use a tagPath prop to look up the corresponding taxonomy definition from ctx.tagMetadataMap. The metadata tells the component the attribute’s data type (string, number, date, SELECTION), the available options for selection fields, the display label, and any validation or formatting rules defined in the taxonomy. This removes the need to duplicate type information in the form definition itself.
Cross-Field Linking with valueFrom
ThevalueFrom prop on v2:attributeEditor displays a value sourced from a different attribute instead of its own:
- Set
valueFromto the tag path of the source attribute. - The field becomes read-only automatically.
- The renderer checks
ctx.formValuesfirst, then falls back to searchingctx.dataObjectsfor a matching attribute path.
invoice/computedTotal displays the value from invoice/lineItemSum and prevents direct editing.
Scoped Contexts with groupTaxon
When av2:panel sets the groupTaxon prop, it scopes the data context for its children:
- The panel filters
ctx.dataObjectsfor objects whosepathmatches thegroupTaxonvalue. - If multiple matching objects exist, the panel renders a tab for each instance.
- Children receive a scoped
DataContextV2containing only the active data object and all of its descendants (collected recursively byparentId). - Nested
groupTaxonpanels work within the already-scoped parent context, enabling hierarchies such as line items within a shipment.
Next Steps
Layout Components
Panels, tabs, rows, columns, and alerts
Data Components
Attribute editors, tables, grids, and more
Extraction
Direct extract and AI-powered data extraction
Events & Scripting
Event handlers, QuickJS runtime, and document API
