update Action
An action to update components in the UI.
{
"update": {
"ids": {
"someID": {
"text": "New text for the component",
"colour": "systemRedColor"
}
}
}
}
Properties
- relayout
- BOOL
- Default: false
Mark the layout as needing to be re-laid out, triggering the layout manager to recacluate.
NoteOnly set to
trueif you expect anupdateto change the sizing metrics of the components you are updating.
- ids
- OBJECT
A map of component ids to the JSON used for updating that component
NoteOn successful
updateofcomponents, the entire UI will only be marked for re-layout if therelayoutflag is set totrue.
Examples
Change properties of a label
{
"type": "view",
"layout": "inline",
"direction": "vertical",
"components": [
{
"id": "exampleLabel",
"type": "label",
"text": "I am a text label to serve as the target"
},
{
"type": "button",
"text": "Modify the label",
"events": [
{
"triggers": "actioned",
"action": {
"type": "json",
"src": {
"update": {
"ids": {
"exampleLabel": {
"text": "My text and colour were changed",
"colour": "systemRedColor"
}
}
}
}
}
}
]
}
]
}