Show alert

Actions – Abstract

The action Show alert creates a specific Type of note that displays the text information displayed by the Alert title and Alert message parameters to the user.

The action Show alert creates a specific Type of note that displays the text information displayed by the Alert title and Alert message parameters to the user.

images/download/attachments/189434389/image-2024-10-15_9-56-13-version-1-modificationdate-1728978973351-api-v2.png


Optionally, a Target element can be linked, which is to receive the focus in connection with the alert. If the Target element allows this, based on its type and the settings valid at runtime, the following happens:

  • In connection with the Type 'Alert box' (default), the focus is only set on the Target element when the hint displayed as a dialog box is closed again.

  • For all other Types, which are displayed as so-called 'notifications' at the right edge of the screen, the focus is set immediately when the message appears.

The text information for the Alert title and Alert message parameters can be assigned using two different methods:

Method for providing text information

Assigning a localization entry

Alerts

images/download/attachments/189434389/image-2024-11-6_16-7-11-version-1-modificationdate-1730905630304-api-v2.png

Whenever a reference to a localization entry is created or updated, it applies to each supported Locale. However, the assignment can be subsequently overridden for selected languages by making a direct entry (see below).

At runtime, the reference is interpreted according to the Locale used in the session via Localization or Company specific localization. In the example, the German text 'Hinweistitel' appears as the alert title, whereas in English 'Alert title' would appear.

Direct input (text, label printout or a combination of both). Examples (with different Types):

images/download/attachments/189434389/image2020-7-9_18-49-52-version-1-modificationdate-1728976706853-api-v2.png

images/download/attachments/189434389/image2020-7-9_18-42-24-version-1-modificationdate-1728976706831-api-v2.png

Only plain text is used here, which is displayed directly.

NOTE◄ In the text, the string \n can be used as a line break to output multiline text.

images/download/attachments/189434389/image2020-7-9_18-50-22-version-1-modificationdate-1728976706856-api-v2.png

images/download/attachments/189434389/image2020-7-9_18-41-47-version-1-modificationdate-1728976706829-api-v2.png

Here plain text is combined with the placeholder $input for the input data.

In the example, the value '10' was entered as input data in a Text field (e.g. by triggering Focus out and changed) and transferred to the action.

images/download/attachments/189434389/image2020-7-9_18-49-21-version-1-modificationdate-1728976706850-api-v2.png

images/download/attachments/189434389/image2020-7-9_18-44-28-version-1-modificationdate-1728976706834-api-v2.png

Here plain text is combined with a reference to a detail within the input data.

In the example, the $input refers to a Repeatable element, whose length property specifies the current number of entries.

images/download/attachments/189434389/image2020-7-9_18-47-40-version-1-modificationdate-1728976706844-api-v2.png

images/download/attachments/189434389/image2020-7-9_18-41-8-version-1-modificationdate-1728976706826-api-v2.png


Here the function avg (Average) is used to calculate an average over all instances of the element with ID#48 ($el(48,true)).

To the left of the result, the appropriate label from the Localization is assigned, using the syntax [Bundle, Resource].

images/download/attachments/189434389/image2020-7-9_18-48-43-version-1-modificationdate-1728976706847-api-v2.png

images/download/attachments/189434389/image2020-7-9_18-45-50-version-1-modificationdate-1728976706837-api-v2.png

----------------------------------------------------------------------------

Following the previous example, the function concatWs (Concatenate texts) is used here to create multiline text output from single values in an element with ID#48 that is inserted within a Repeatable element container. The character string \n is used as a separator, which is interpreted as a line break.

Direct input must always be entered individually for each supported Locale, otherwise no text may appear in the respective language.

As shown in the last example, Calculation expression can also contain references to localization entries.

The Type parameter defines the appearance of the alert at runtime and also has functional effects:

Type

Category

Example

Alert box

Dialog

  • must be closed with the 'OK' button or with the 'X' symbol (top right)

  • considers the Lock option, which determines whether the current view is locked until the alert box is closed (option set) or remains accessible while the alert box is displayed (option not set)

images/download/attachments/189434389/image2020-7-9_18-45-50-version-1-modificationdate-1728976706837-api-v2.png

Notification: Info

Notification

  • appears at the right margin in the browser

  • can be closed by the 'X' symbol (top right)

  • takes into account the Close after (seconds) parameter, which determines the time after which a displayed message automatically disappears (setting: >0 seconds) or whether it should remain displayed 'indefinitely' (until interactive closing) (setting: 0 seconds)

images/download/attachments/189434389/image2020-7-9_18-41-8-version-1-modificationdate-1728976706826-api-v2.png

Notification: Error

images/download/attachments/189434389/image2020-7-9_18-44-28-version-1-modificationdate-1728976706834-api-v2.png

Notification: Warning

images/download/attachments/189434389/image2020-7-9_18-42-24-version-1-modificationdate-1728976706831-api-v2.png

Notification: Success

images/download/attachments/189434389/image2020-7-9_18-41-47-version-1-modificationdate-1728976706829-api-v2.png

Example

A form lists a table of order positions in a Repeatable element container.

At the push of a button, the most expensive individual item is determined, the associated amount is displayed and the text of the corresponding position is then focused.

Runtime example:

Under Goto ... the Maximum Button was pressed. The most expensive order position is determined and the amount appears in an 'alert box':

images/download/attachments/189434389/image2020-7-9_19-0-11-version-1-modificationdate-1728976706859-api-v2.png

After confirming the reference with OK, the focus is set in the 'Order position' Text field of the corresponding purchase order:

images/download/attachments/189434389/image2020-7-9_19-0-40-version-1-modificationdate-1728976706863-api-v2.png

Confiiguration:

images/download/attachments/189434389/image-2024-10-15_9-54-51-version-1-modificationdate-1728978890873-api-v2.png

For the Price Text field, which allows the input of numerical values, the behaviour 'maximumAlert' shown on the left is configured:

  • The behaviour does not specify a trigger, because it should only be triggered by the Execute behaviour action via the Maximum Button.


  • The Behaviour type Compare with is used to determine whether the entered numerical value is 'equal' (Compare type) to the value from the 'expression' (Compare source). The specified Calculation expression uses the function max (Maximum) to determine the highest value over all instances for the 'Price' Text field (with the element-ID#48). The Actions on 'true' are executed if this comparison is correct. In this case, the entry evaluated is the 'highest value' order position within the surrounding Repeatable element containers.


Under the Actions on 'true' a Show alert action is executed, which uses the Calculation expression already used in the behaviour type to determine the maximum value searched for, in addition to the Alert title 'MAXIMUM' in the Alert message. The type selected is 'Alert note', since the linked Target element, the 'Order position' Text field, should only be focused after the note has been acknowledged.

images/download/attachments/189434389/image-2024-10-15_10-57-38-version-1-modificationdate-1728982658229-api-v2.png

In order to trigger the evaluation of the 'Order position' via the Maximum Button, the 'gotoMax' behaviour shown on the left is configured

  • The behaviour reacts to the Triggering event Click.


  • The Behaviour type Static ensures that the Actions on 'true' are executed unconditionally.


  • Under the Actions on 'true' the behaviour 'maximumAlert' is called by the Execute behaviour action, which is configured in the Target element (Text field 'Price'), as described above. The decisive factor here is the For duplicates also option, which ensures that all instances of the target element are evaluated.

NOTE◄ If the maximum value for the amount is found in more than one invoice item, a separate note is generated for each discovery, which must be acknowledged. As the alert boxes appear 'stacked', the focus moves backwards through the list, as the last displayed alert is confirmed first.

NOTE◄ The described configuration can be optimized in terms of performance, so that the calculation expression $max($el(48,true))has to be executed only once. If this expression is used as a Value expression instead of $input in the Execute behaviour action of the 'gotoMax' behaviour, the called behaviour 'maximumAlert' gets the maximum value as $input, to which the Compare with behaviour type as a Calculation expression and the Show alert action can refer as an Alert message. However, the configuration then appears somewhat less transparent. Therefore the procedure above is different.