Form Scripting¶
Emakin forms support scripting for custom behavior and dynamic form interactions. Scripts can execute operations before a form is rendered or respond to changes in the data model. Library functions like $Xml provide essential data operations.
$Form Variable Overview¶
The $Form
variable provides access to form properties and functions for managing form elements dynamically.
1 2 3 4 5 6 7 8 |
|
Change Form Section States Dynamically¶
Form section states are defined by task properties but can also be updated dynamically through scripting.
1 2 3 |
|
Available Section States:
State | Description |
---|---|
(Empty) | Default state |
Hidden | Hides the section |
Disabled | Makes section read-only |
Attach Change Events¶
Use the $Xml.Bind
method to attach a change event to an existing element in the data model.
1 2 3 |
|
For elements that may not exist at the time of form rendering, use the $Xml.Live
method. It attaches event listeners to future elements when they are created.
1 2 3 |
|