Alert

An Alert Container is a basic container with one of the predefined Contexts (success, information, warning or error) to show information with that specific context. These are useful, but not limited, to displaying warning/error messages after validations (for example, validations after submitting a form).

Properties

PropertiesDescription

Style Context

When toggled on, the Panel shows a small arrow to fold or unfold the block panel’s body depending on the condition (see'"Body is expanded when' property).

Show close button

Optionally, you could show a 'x' button at the top-right corner of the Alert container, which can be used to close the Alert at Runtime.

Icon

You can add an icon that is displayed in a predefined position (top-left within the container) as explained in the Illustration.

Illustration

This illustration makes use of elements like Panel and Conditional. Refer the linked pages if you would like to learn more about these widgets.

Let's continue with the EMS use case from the last topic, Panel, where we had constructed the Employees Overview page. Let's now try to display a warning alert message within the Panel when the employee has no Role assigned.

This is what we had from the last topic, Panel.

1. Continuing from the above, add a conditional inside the Panel that checks whether the employee's role is empty.

2. Click on the 'Alert' icon in the Template Editor, drag and drop it on the canvas at the place where you would like to insert it.

By default, an Alert of 'warning' context is inserted.

2. Click on the flag icon under 'Icon' in the Properties pane and search for a warning icon.

3. Select an icon, click 'Ok'.

The icon is added to the Alert.

4. Add text to the Alert, either by typing in directly, or using a Label.

5. Save the Template Editor and Preview.

Last updated