API Reference - HMI.actionListDialog
This API allows to interact with the HMI actionListDialog element.
Input Parameter | |||||
---|---|---|---|---|---|
Param name | Description | Type | Unit/Values | Example | Required |
title | Name of the actionListDialog icon. |
string |
|
My actionListDialog.
|
true |
text | Name of the actionListDialog icon. |
string |
|
This actionListDialog allows to do many things:
|
true |
icon | URI (filesystem or image data) of the actionListDialog icon. |
string |
|
file:///vdappdata/HMI/...
|
true |
actionList | Array of Objects |
/ | / |
|
|
actionList
.id |
Id of this action. |
string |
timestamp
|
true |
|
actionList
.title |
Name of this action. |
string |
First Action
|
true |
|
actionList
.text |
Text of this action. |
string |
This action allowws to do something.
|
true |
|
actionList
.icon |
URI (filesystem or image data) of this action icon. |
string |
data:image/png;base64,...
|
true |
Output Data | ||||
---|---|---|---|---|
Data name | Description | Type | Unit/Values | Example |
dialogId | ID of the actionListDialog you just set-up. This ID is also returned in Susbscribe. |
int |
|
42
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
webportal.set(
/* api name */
"HMI.actionListDialog",
/* parameters */
{
"title": "My actionListDialog.",
"text": "This actionListDialog allows to do many things:",
"icon": "file:///vdappdata/HMI/...",
"actionList": ""
}
)
/* callback for `REPLY` messages */
.then((message) => {
if (message.status === 200) {
/* handle `REPLY` success */
}
else { /* handle `REPLY` error */ }
})
1
2
3
4
5
6
7
8
9
10
11
{
"id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
"type": "SET",
"api": "HMI.actionListDialog",
"params": {
"title": "My actionListDialog.",
"text": "This actionListDialog allows to do many things:",
"icon": "file:///vdappdata/HMI/...",
"actionList": ""
}
}
1
2
3
4
5
6
7
8
9
10
// --- format of the `REPLY` message ---
{
"id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
"type": "REPLY",
"api": "HMI.actionListDialog",
"status": 200,
"statusText": "OK",
"data": 42
}
false
This API allows to interact with the HMI actionListDialog element.
Input Parameter | |||||
---|---|---|---|---|---|
Param name | Description | Type | Unit/Values | Example | Required |
dialogId | ID of the actionListDialog you want to subscribe to. If not provided will subscribe to every dialogs. |
int |
|
42
|
false |
Output Data | ||||
---|---|---|---|---|
Data name | Description | Type | Unit/Values | Example |
dialogId | ID of the actionListDialog being triggered. This ID is also returned in Set. |
int |
|
42
|
eventType | Dialog event related to the triggering of this actionListDialog. |
Enum of strings |
- created
- opened
- closed
|
created
|
target (dialog) | . |
String |
|
dialog
|
eventType | Button event related to the triggering of this actionListDialog. |
Enum of strings |
|
pressed
|
target (button) | . |
String |
|
listItem
|
selectedIndex | Index of the selected item (zero-based). |
int |
|
2
|
selectedItem | Value of selected item’s id attribute. |
String |
|
ghi
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
webportal.subscribe(
/* api name */
"HMI.actionListDialog",
/* parameters */
42,
/* callback for `NOTIFY` messages */
async (notifyMessage) => {
if (notifyMessage.status === 200) {
/* handle `NOTIFY` response */
}
else { /* handle `NOTIFY` error */ }
}
)
/* callback for `REPLY` messages */
.then((message) => {
if (message.status === 200) {
/* handle `REPLY` success */
}
else { /* handle `REPLY` error */ }
})
1
2
3
4
5
6
{
"id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
"type": "SUBSCRIBE",
"api": "HMI.actionListDialog",
"params": 42
}
1
2
3
4
5
6
7
8
9
10
11
// --- format of the `REPLY` message ---
// type: acknowledge the status of the subscription
// reception: only once after the subscription request
// contains outputed data: no
{
"id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
"type": "REPLY",
"status": 200,
"statusText": "OK"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// --- format of the `NOTIFY` message ---
// type: event message about the subscription
// reception: each time the conditions of the subscription are met
// contains outputed data: yes
{
"id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
"type": "NOTIFY",
"api": "HMI.actionListDialog",
"status": 200,
"statusText": "OK",
"data": {
"dialogId": 42,
"eventType": "created",
"target (dialog)": "dialog",
"eventType": "pressed",
"target (button)": "listItem",
"selectedIndex": 2,
"selectedItem": "ghi"
}
}