Button Block – runs an action¶
The button block runs an action when it is clicked – against the record of the form. The button only decides how it looks and when it can be clicked; the work belongs in the action. Further button blocks inside it turn it into a menu.
This page is part of the form block reference.
1. At a glance¶
| Purpose | Starts an action; optionally opens a menu of further buttons |
| Typical use | "Escalate", "Send reply", "Close ticket" |
| Related | Toolbar Block, Element Block, Actions |
For the main actions of a form, a Toolbar Block with an app bar is usually the better place: a row of single buttons is the same thing built by hand.
2. Settings¶
| Setting | Meaning | Default |
|---|---|---|
| "Button Text" | Caption of the button; can change with the record | none |
| "Variant" | Look of the button: Default, Primary, Secondary, Outlined, Primary Outline, Subtle, Ghost, Link, Danger – the same set app bars offer | Default |
| "Click Action" | Action run on a click | none – the button does nothing |
| "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 under which the button cannot be clicked | not disabled |
| "Image" (Appearance) | Icon on the button | none |
| "Image Position" (Appearance) | Position of the icon relative to the text: Left, Right, Top, Bottom | Left |
| "Focus On Open", "Skip In Tab Order" | Places the cursor into the button when the form opens; lets the Tab key pass over it. See Cursor and tab key. | never, off |
In a form without an entity, the click actions run without a record. In addition, the block has the settings every block has, including "Flush".
A button with a menu¶
A button block can contain further button blocks – and only button blocks. The button then opens a menu with them when clicked, and its own "Click Action" is not run. Every entry of the menu has its own text, icon, actions and disabled condition.
3. Behaviour¶
- The action runs against the record of the form. If the user has just changed a value, the action waits until the change is applied, so it never works with the old value.
- Use "Disabled" to say when an action does not apply, rather than letting the action refuse afterwards: the user sees it before clicking.
- A button inside a Repeater Block hands the variables of its repetition to the action – each row can act on its own element.
- A button inside a stored block hands the parameters of the stored block to the action as variables.
- Inside a related items block with a disabled condition, the button is disabled as well.
4. Examples¶
Escalate. "Button Text" = Escalate, "Variant" = Danger, "Image" = a warning icon,
"Click Action" = the action "Escalate Ticket", "Disabled" = Status = "Closed".
More actions in a menu. A button "More" with "Variant" = Ghost contains three button blocks "Duplicate", "Merge" and "Export as PDF", each with its own action.