DataContext

Where a component evaluates its dynamic values (A2UI "evaluation scope"): absolute paths resolve from the surface's data model; relative paths from base, the item a list template is rendering (at index). Resolves Dynamic* values: literals, {"path": …} bindings and {"call": …} function calls, including formatString ${…} interpolation.

Properties

Link copied to clipboard

The collection item this scope renders, e.g. /employees/1; empty at the root.

Link copied to clipboard
val index: Int?
Link copied to clipboard
Link copied to clipboard

True only while handling a user's action (A2UI user-activation rule, e.g. for openUrl).

Functions

Link copied to clipboard
fun absolute(path: String): String

A path made absolute in this scope.

Link copied to clipboard
fun boolean(value: JsonElement?): Boolean?
Link copied to clipboard
fun call(call: JsonObject): JsonElement?

Run a function call in this scope; @index is the system function of template items.

Link copied to clipboard
fun interpolate(template: String): String

formatString: the template's parsed parts evaluated in this scope. A part that cannot be evaluated renders empty; a template that does not parse shows as written.

Link copied to clipboard
fun item(path: String, i: Int): DataContext

The scope of item i of the list at path (a template instance).

Link copied to clipboard
fun number(value: JsonElement?): Double?
Link copied to clipboard
fun resolve(value: JsonElement?): JsonElement?

A dynamic value resolved to plain JSON (null when unbound or not yet sent).

Link copied to clipboard
fun string(value: JsonElement?): String?
Link copied to clipboard
fun stringList(value: JsonElement?): List<String>