Dialog

A common dialog definition that may be referenced by other Connect modules and from JavaScript API calls.

For example, take the following dialog module:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "modules": {
    "dialogs": [
      {
        "url": "/my-dialog-content",
        "options": {
          "size": "fullscreen",
          "header": {
            "value": "Example Dialog"
          }
        },
        "key": "dialog-module-key"
      }
    ]
  }
}

This common dialog might be referenced from a web item target, so that triggering the web item launches the dialog:

1
2
3
4
5
6
7
8
9
{
  "target": {
    "type": "dialogmodule",
    "options": {
      "key": "dialog-module-key"
    }
  }
}

The common dialog might also be referenced when creating a Dialog manually with the JavaScript API:

1
2
3
4
5
6
7

 AP.require('dialog', function(dialog){
   dialog.create({
     key: 'dialog-module-key'
   }).on("close", callbackFunc);
 });
 

Properties

key
Type
Max length
100
Required
Yes
Pattern
^[a-zA-Z0-9-]+$
Description

A key to identify this module.

This key must be unique relative to the add on, with the exception of Confluence macros: Their keys need to be globally unique.

Keys must only contain alphanumeric characters and dashes.

The key is used to generate the url to your add-on's module. The url is generated as a combination of your add-on key and module key. For example, an add-on which looks like:

1
2
3
4
5
6
7
8
9
{
    "key": "my-addon",
    "modules": {
        "configurePage": {
            "key": "configure-me",
        }
    }
}

Will have a configuration page module with a URL of /plugins/servlet/ac/my-addon/configure-me.


url
Type
Format
uri-template
Required
Yes
Description

Specifies the URL of the content displayed in the dialog. The URL can be absolute or relative to either the product URL or the add-on's base URL, depending on the context attribute.

Your add-on can receive additional context from the application by using variable tokens in the URL attribute.


cacheable
Type
Defaults to
false
Description

Returns whether the URL should be cacheable. Cacheable URLs are taken directly from the add-on descriptor, and lack all additional query parameters:

  • standard iframe query parameters
  • product context parameters
  • JWT token


options
Type
Description

An object containing options for this dialog.

Options for a modal dialog web item target or common module.

These options are a subset of those available via the JavaScript API.

Web Item Example

1
2
3
4
5
6
7
8
9
10
{
  "target": {
    "type": "dialog",
    "options": {
      "height": "100px",
      "width": "200px"
    }
  }
}

Dialog Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "modules": {
    "dialogs": [
      {
        "url": "/my-dialog-content",
        "options": {
          "size": "fullscreen",
          "header": {
            "value": "Example Dialog"
          }
        },
        "key": "dialog-module-key"
      }
    ]
  }
}

Properties

chrome
Type
Defaults to
true
Description

Whether the dialog should contain the AUI header and buttons.

header
Type
Description

The header text for the dialog, if chrome is enabled.

Represents a string that can be resolved via a localization properties file. You can use the same i18n Property key and value in multiple places if you like, but identical keys must have identical values.

Example

1
2
3
4
{
  "value": "My text"
}
height
Type
Max length
10
Description

Sets how high the dialog is in pixels

size
Type
Allowed values
  • small
  • SMALL
  • medium
  • MEDIUM
  • large
  • LARGE
  • x-large
  • X-LARGE
  • fullscreen
  • FULLSCREEN
  • maximum
  • MAXIMUM
Description

Sets the size of the dialog.

This option is used instead of the 'height' and 'width' options.

width
Type
Max length
10
Description

Sets how wide the dialog is in pixels.


Rate this page: