Alert Notification
Summary
- AdapTable Alerts can be configured to display a Notification when triggered
- The Notification can be configured to display an AdapTable Form which can be one of 2 types:
- fully defined form with a full range of controls (can include multiple inputs, buttons and other UI controls)
- reduced form with Alert Command Buttons which are wired up to System (and Custom) Alert Commands
A very common Alert Behaviour is to display a Toast Notification whenever the Alert fires.
Hint
This is done by setting DisplayNotification to true in the AlertProperties section of the Alert Definition
By default the Notification will display the Alert's Message - the Header and Text that describe the Alert.
Find Out More
See Alert Message for instructions on the different ways this Message can be provided
Alternatively, the Notification can be configured, instead, to show an Adaptable Form.
This Alert Form can be configured to render 2 different sets of content
- a set of Alert Buttons - each with an associated Alert Command
- a fully featured Alert Form (including any UI controls that are required)
Alert Command Buttons
The Alert Notification can be configured to show a set of Alert Command Buttons.
Alert Command Buttons are highly-configurable Adaptable Buttons, with many properties available, e.g. for managing style, visibility, and enabled status.
Note
If using OpenFin or interop.io Plugins, these buttons will display with other Notifications shown by those containers
Each Button has an, additional, Actions property - which can contain an array of Alert Button Actions.
As the name implies, these actions will do something when the Button is clicked.
Hint
AdapTable will automatically wire up these Actions to the onClick of the Button
There are 2 types of Alert Command Buttons:
- System Command Buttons - shipped by AdapTable for the most common use cases (so far 7 are available)
- Custom Command Buttons - provided by developers to deal with bespoke requirements
Caution
- Alert Commands differ to Alert Behaviours as the latter trigger when the Alert itself is fired
- However Alert Commands trigger when a Button in an Alert Form is clicked
Alert Command Buttons can be provided by:
- developers using Alert Initial State (via the
AlertFormproperty of theAlert Definition) - by run-time users in the
Notificationsection of the Alert Wizard
Caution
Alerts created by end users at run-time can only contain Command Buttons (and not fully-featured Alert Forms)
System Alert Button Actions
AdapTable provides 7 Alert Commands, selectable by end-users when creating an Alert in the AdapTable UI:
highlight-cellhighlight-rowjump-to-celljump-to-rowjump-to-columnsuspendundo
Hint
The suspend Action essentially sets the IsSuspended property in the Alert Definition to true
- This demo fires an Alert when any value in
Github Starscolumn is changed - It displays a Notification with 2 Buttons that are attached to System Alert Commands:
Show Me- is wired up to 2 Commands:highlight-cellandjump-to-cellUndo- triggers 1 Command:undo
- Edit a cell in the
Github StarsColumn and see the Alert with 2 Actions. Click 'Notify' to see the System Status message which is sent
Custom Alert Button Actions
In addition to the Alert Commands provided by AdapTable, developers can supply their own Commands.
This is done via the commandHandlers property in Alert Options.
Note
- Custom Alert Commands can then be referenced in Alert Initial State, where they can be "wired up" to Alert Buttons
- Additionally AdapTable will display them in the Notifications step in the Alert Wizard to assist run-time users
commandHandlers
- This demo fires an Alert when any value in
Github Starscolumn is changed. - The Alert displays a Notification with a
NotifyButton which is attached to a Custom (i.e. bespoke) Alert Commandemail-support - Note: for this impelementation we simply send a System Status Message but a real world implementation would be different
- Edit a cell in the
Github StarsColumn and see the Alert with the 'Notify' Button - Click the Button to see the System Status message which is sent
Alert Forms
The Alert Notification can be configured, instead, to render a full Alert Form.
This is a fully-featured, UI-rich Adaptable Form, containing multiple inputs and controls (with validation).
An Alert Form can only be configured by developers at design-time, and requires a 2-step process:
- The Form is configured in full in the
alertFormssection of Alert Options - The Form is referenced by name in the
AlertFormproperty of theAlert Definitionin Alert Initial State
Find Out More
The Adaptable Form Guide has full instructions on configuring dynamic Forms with multiple inputs and validation
alertForms
- This demo displays an Alert Form when a cell in
Github Starscolumn is given a negative value - The Form contains 3 elements:
- a numeric input which will receive the new value for the Cell
- a
Setbutton - which will replace the 0 in the Cell with the value provided in the input - a
CancelButton - which will revert the Cell to its initial value
- Set a
GitHub Starscell to a negative value and see the Alert Form appear with the input and the 2 buttons - Provide a new value and click 'Set' and note how the cell updates
- Click 'Cancel' and note how the cell reverts to the initial value