Skip to main content
Version: Next (5.0)

Button

A button launches the actions attached to it: searching, saving, confirming or opening a dialog. Below is the real button of the AWE React client. Change its attributes and the XML below follows; copy it into your screen.

Live preview
XML
<button id="demo" label="Save changes" button-type="submit" icon="save" />

The controls above write these attributes. The reference lists every attribute, its type and default. Attributes in the XSD reference

AttributeControlValues
labelLabeltext
button-typeButton typebuttonsubmitreset
styleLookbtn-primarybtn-defaultbtn-dangerbtn-successbtn-warningbtn-darkbtn-ghostbtn-tonal
iconIconsavesearchtrashplusdownloadsendcheck
sizeSizesmlg
styleIcon onlytrue / false
helpHelp tooltiptext
dependencyDisabled by a dependencytrue / false

Recipes​

Common buttons, rendered by the same component. Server actions are simulated in these examples, so clicking does not call a server.

Main action of a form​

A submit button with a primary style: it is the one that runs when the user presses Enter inside a criterion.

<button id="search" label="Search" button-type="submit" icon="search" style="btn-primary">
<button-action type="filter" target="GrdUsrLst" />
</button>

Confirm before deleting​

The confirm action stops the chain until the user accepts; the server action that follows only runs then.

<button id="del" label="Delete" icon="trash" style="btn-danger">
<button-action type="confirm" target="DelMsg" />
<button-action type="server" server-action="maintain" target-action="UsrDel" />
<button-action type="filter" target="GrdUsrLst" />
</button>

Icon-only button​

no-label draws only the icon. The label stays: it is the tooltip and the accessible name that screen readers announce.

<button id="help" label="Help" icon="question-circle" style="btn-ghost no-label">
<button-action type="dialog" target="HlpOpt" />
</button>

Events and actions​

The button has one event, click. Clicking it launches its button-action elements in order. See actions for every action type and dependencies to enable, disable or hide a button from the state of the screen.

EventDescription
clickLaunched when an user clicks the button

More​