scripting: onCreate: expose value and call onCreate after default value is applied

This commit is contained in:
jean-emmanuel 2022-11-29 08:57:38 +01:00
parent 6ef1d412f9
commit 5230eb2d4b
6 changed files with 14 additions and 4 deletions

View file

@ -68,6 +68,7 @@ This syntax creates a custom variable in the widget that can be read and modifie
This allows loading the content of an external file in a property. If used in a `JS{}` of `#{}` block, it will be seen as a string variable containing the raw content of the file. Changes made to the file be applied automatically.
File paths are resolved in this order:
- in the session's directory
- in theme's directory
- in the server's `remote-root` directory if the option is set

View file

@ -21,6 +21,10 @@ This script is called when the widget is created. If the widget has children, it
!!! warning "Modifying parent container"
Modifying a non-dynamic property on a parent container from this script **will not work**.
The following variables are available in this context:
- `value`: widget's value
### `onValue`
This script is called when the widget's value updates and when it receives a value.