Webportal v2

embedded apps

API Reference - HMI.actionbarWindowDialog

Required Privacy: Data & Location
Operations:

This API allows to create and interact with the HMI actionbarWindowDialog element.

Input Parameter
Param name Description Type Unit/Values Example Required
contentUrl

URI of the action bar window diaog page content.

string

n/a

https://content.com/dialog.html true
fullscreen

Display fullscreen? Default false.

boolean

n/a

false false
primaryButton1Icon

Base 64 encoded URI of primary butto first icon.

string

n/a

aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA== true
primaryButton2Icon

Base 64 encoded URI of primary button second icon.

string

n/a

aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA== true
primaryButton3Icon

Base 64 encoded URI of primary button third icon.

string

n/a

aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA== true
secondaryButton1Icon

Base 64 encoded URI of secondary button first icon.

string

n/a

aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA== true
secondaryButton2Icon

Base 64 encoded URI of secondary button second icon.

string

n/a

aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA== true
secondaryButton3Icon

Base 64 encoded URI of secondary button third icon.

string

n/a

aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA== true
secondaryButton4Icon

Base 64 encoded URI of secondary button fourth icon.

string

n/a

aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA== true
userData

Custom parameters of any types available when notification activity is triggered.

Object

n/a

{"custom"=>"payload", "myObj"=>{"a"=>"hello", "b"=>[1, 2, 3]}} false
Output Data
Data name Description Type Unit/Values Example
dialogId

ID of the actionbarWindowDialog you just set-up. This ID is also returned in Susbscribe.

int

n/a

42
dialogOpenError

Error code related to the toast.

int

- 0: Dialog successfully openeded.

- 1: Failed, unspecified error happened.

- 2: Failed, invalid parameters were passed.

- 3: Failed, higher priority panel is currently shown on the screen.

- 4: Failed, discarded because incorrect specific conditions.
0
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
24
webportal.set(
    /* api name */
    "HMI.actionbarWindowDialog",
    /* parameters */
     { 
      "contentUrl": "https://content.com/dialog.html",
      "fullscreen": false,
      "primaryButton1Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
      "primaryButton2Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
      "primaryButton3Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
      "secondaryButton1Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
      "secondaryButton2Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
      "secondaryButton3Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
      "secondaryButton4Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
      "userData": "{"custom"=>"payload", "myObj"=>{"a"=>"hello", "b"=>[1, 2, 3]}}"
        }
  )
  /* 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
17
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "SET", 
  "api": "HMI.actionbarWindowDialog",
  "params":  { 
    "contentUrl": "https://content.com/dialog.html",
    "fullscreen": false,
    "primaryButton1Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
    "primaryButton2Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
    "primaryButton3Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
    "secondaryButton1Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
    "secondaryButton2Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
    "secondaryButton3Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
    "secondaryButton4Icon": "aHR0cHM6Ly9jb250ZW50LmNvbS9kaWFsb2cuaHRtbA==",
    "userData": "{"custom"=>"payload", "myObj"=>{"a"=>"hello", "b"=>[1, 2, 3]}}"
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
// --- format of the `REPLY` message ---

{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "REPLY",
  "api": "HMI.actionbarWindowDialog",
  "status": 200,
  "statusText": "OK", 
  "data":  { 
    "dialogId": 42,
    "dialogOpenError": 0
  } 
}

false

This API allows to create and interact with the HMI actionbarWindowDialog element.

Input Parameter
Param name Description Type Unit/Values Example Required
dialogId

ID of the actionbarWindowDialog you want to subscribe. 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 actionbarWindowDialog being triggered. This ID is also returned in Set.

int

n/a

42
eventType (button)

Button related to the triggering of this actionbarWindowDialog.

Enum of strings

- primaryButton1

- primaryButton2

- primaryButton3

- secondaryButton1

- secondaryButton2

- secondaryButton3

- secondaryButton4
primaryButton1
target (button)

.

String

n/a

dialog
eventType (dialog)

Event related to the triggering of this actionbarWindowDialog.

Enum of strings

- open

- close
close
target (dialog)

.

String

n/a

dialog
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.actionbarWindowDialog",
    /* 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.actionbarWindowDialog",
  "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
// --- 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.actionbarWindowDialog",
  "status": 200,
  "statusText": "OK", 
  "data":  { 
    "dialogId": 42,
    "eventType (button)": "primaryButton1",
    "target (button)": "dialog",
    "eventType (dialog)": "close",
    "target (dialog)": "dialog"
  } 
}