askUser
Shows a modal pop up with buttons. The list of buttons and events are referencing each other, so the button on index n will trigger the event on the same index.
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"actions" | Array | A list of actions that are fired when the button with the same index is clicked. | null |
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"buttons" | Array | A list of texts that are displayed as buttons. | null |
"events" | Array | A list of events that are fired when the button with the same index is clicked. | null |
"isCancelable" | Boolean,String | Indicates whether the pop up can be closed by clicking outside the pop up or via the Back button. | false |
"message" | String | The text of the pop up. | null |
"onCancel" | String | This event is fired on cancellation. | null |
"title" | String | The title of the pop up. | null |
Inherited
From Base Action
Base Action
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"dynamicParams" | Object | Dynamic params to retrieve data from a specific context e.g. a userSetting. | null |
"leadingDelimiter" | String | The leading mustache delimiter to use. | null |
"params" | Object,Array | Object containing the properties of the action. | null |
"trailingDelimiter" | String | The trailing mustache delimiter to use. | null |
"type" | String | Type name of the action. | null |
Examples
Example 1: Create an askUser action
Goal: Create an askUser action with two options.
In this case, the event nothingPicked
is fired on cancellation.
{
"type": "askUser",
"params": {
"title": "Leave the Matrix?",
"message": "Take a pill",
"isCancelable": true,
"onCancel": "nothingPicked",
"buttons": [
"Red Pill",
"Blue Pill"
],
"events": [
"pickedRed",
"pickedBlue"
]
}
}
The button
list can contain simple strings or objects with the fields:
label
: text on the buttonimage
: image on the left side of the button
Result:
An askUser action has been created.