Skip to main content

ref and local commands

Address a documented command on an attached element.

Quick reference​

SyntaxBehavior
ref="nameInput"Declares a local command target.
call refs.nameInput.focusInvokes a registered command.

Example​

<Column>
<TextField ref="nameInput" label="Name" />
<Button title="Focus name" on-press="call refs.nameInput.focus" />
</Column>

Rules and validation​

Refs are local identifiers, not arbitrary native objects. Only documented commands are reachable. Missing attachment targets fail with missingRef. A ref does not extend the lifetime of a removed instance. TextField/TextArea support focus/blur; Scroll supports scrollTo.

call · TextField · Scroll