Update a panel
Changes a view in a panel that is showing: a number, some text, a table's rows, a chart's points.
Update panel id
Details #
Finds the panel by its id and sets views in it by their id. Each entry of set is either a plain value or an object of properties to change.
A plain value replaces the view's main value: a text's text, a field, toggle, slider, picker or progress value, a table's rows, a chart's data, a button's title, an image's symbol. An object changes the properties you name and leaves the rest: {"status": {"text": "Almost there", "style": "caption"}}. A view's type, id and children cannot be changed, and neither can a field's kind or a button's run.
The change is checked against the same vocabulary and limits as the panel itself before anything moves; a bad update changes nothing, fails the step with where the problem is, and shows it in red under the panel's title. Changes land on the next frame (about 16 ms), and several changes to one view inside a frame draw once, so a loop can update a bar as fast as it likes. They animate with the system's quick spring, or cross-fade when Reduce Motion is on.
A field the person is typing in keeps what they typed: its new value is dropped unless force is on. Replacing a table's rows clears the chosen row.
If no panel has that id, the step fails with "no panel called 'dl' is showing; it may have been closed".
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
id | text | Yes | The panel's id. | |
set | record | Yes | Views by id: {"bar": 0.4, "status": "Downloading 40%"}. | |
force | yes / no | Replace the text of a field even while it has the keyboard. |
Every step also accepts label, onFailure, timeout and dryRunSafe.
Examples #
- Show panel “Working” and carry on
- Update panel “job” (2 things)
- Wait 1 s
- Close panel “job”
Gotchas #
Update a table by giving
rowsagain:{"results": [{"name": "…"}]}.A text value that is only
{{ }}keeps its type, so"bar": "{{ i / 20 }}"sets a number.