Webportal v2

embedded apps

API Reference - HMI.actionListDialog

Required Privacy: Data & Location
Plateforme Compatibility:
Operations:

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

n/a

My actionListDialog. true
text

Name of the actionListDialog icon.

string

n/a

This actionListDialog allow to do many things: true
icon

URI (filesystem or image data) of the actionListDialog icon.

string

n/a

file:///vdappdata/HMI/... true
actionList

Array of Objects

/ /
actionList
 .id

Id of this action.

string

n/a

timestamp true
actionList
 .title

Name of this action.

string

n/a

First Action true
actionList
 .text

Text of this action.

string

n/a

This action allowws to do something. true
actionList
 .icon

URI (filesystem or image data) of this action icon.

string

n/a

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

n/a

42
Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
webportal.set(
    /* api name */
    "HMI.actionListDialog",
    /* parameters */
     {
    "id": "abc",
    "title": "....",
    "text": "...",
    "title": "Car maintenance reminder",
    "text": "Your appointment with your favorite garage has been confirmed.",
    "actionList": [
        {"id": "def", "title": "....", "text": "...", "icon": "data:image/png;base64,..."},
        {"id": "ghi", "title": "....", "text": "...", "icon": "data:image/png;base64,..."},
    ]
  } 
  )
  /* 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
12
13
14
15
16
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "SET", 
  "api": "HMI.actionListDialog",
  "params":  {
    "id": "abc",
    "title": "....",
    "text": "...",
    "title": "Car maintenance reminder",
    "text": "Your appointment with your favorite garage has been confirmed.",
    "actionList": [
        {"id": "def", "title": "....", "text": "...", "icon": "data:image/png;base64,..."},
        {"id": "ghi", "title": "....", "text": "...", "icon": "data:image/png;base64,..."},
    ]
  } 
}
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

n/a

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

n/a

42
eventType

Dialog event related to the triggering of this actionListDialog.

Enum of strings

- created

- opened

- closed
created
target (dialog)

.

String

n/a

dialog
eventType

Button event related to the triggering of this actionListDialog.

Enum of strings

pressed

pressed
target (button)

.

String

n/a

listItem
selectedIndex

Index of the selected item (zero-based).

int

n/a

2
selectedItem

Value of selected item’s id attribute.

String

n/a

ghi
Code Example
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"
  } 
}