Button Block – a button that runs an action¶
The button runs an action when it is clicked. It only decides how it looks and when it can be clicked – the work belongs to the action.
This page is part of the widget reference.
1. At a glance¶
| Purpose | Starts an action |
| Typical use | "New ticket", "Show all open orders", "Start import" |
| Related | App-Bar Block for a row of buttons or a menu, Badge |
2. Settings¶
In addition, the widget has the settings every widget has, including "Flush".
| Setting | Meaning | Default |
|---|---|---|
| "Button Text" | The caption, computed | none |
| "Image" | An icon on the button, an image expression | none |
| "Image Position" | Position of the icon relative to the text: Left, Right, Top, Bottom (category Appearance) | Left |
| "Variant" | Default, Primary, Secondary, Outlined, Primary Outline, Subtle, Ghost, Link, Danger – the same styles as app bar items | Default |
| "Click Action" | The action run on a click | none |
| "Shift-Click Action", "Ctrl-Click Action", "Alt-Click Action" | Actions run on a click with the Shift, Ctrl or Alt key held | none |
| "Disabled" | Condition that makes the button unclickable | never |
A button needs a "Button Text", an "Image" or both, and at least one click action.
3. Behaviour¶
- The action runs without a record. It can read the parameters of the dashboard.
- While the action runs, the button is disabled and cannot be clicked a second time.
- Use "Disabled" to say when the action does not apply, instead of letting the action refuse afterwards.
- With "Auto Refresh" caption, icon and disabled state are evaluated again.
4. Example¶
Create a ticket. "Button Text" "New ticket", "Image" the icon "add", "Variant" Primary, "Click Action" an action that creates a ticket and opens its form.
5. Limitations¶
- Drop-down buttons, as the button block of a form offers them, are not shown on dashboards. Use an App-Bar Block for a menu.