IFrame

This widget can be used to show images or videos.

Model

{
    "type": "iframe",
    "actions": {},
    "dataSource": {},
    "iframeOptions": {
        "allowFullScreen": true
    },
    "toolbars": {},
    "url": ""
}
Field Description

actions

Optional property used to implement action pipelines for selected trigger events. See the actions section in the widget documentation for more details.

dataSource

Optional property used to retrieve data from the system

iframeOptions

Any valid iframe attributes can be added to the model. See the full list of attributes here: The Inline Frame element

toolbars

Add, customise or hide toolbars. See the toolbars section below.

url

Parameter containing a URL as a string. This should be the location of the webpage, image, document or video to be shown in the iframe.

DataSource

Refer to the generic widget page for a description of the general principles governing the treatment of data retrieved from a dataSource.

If the dataSource property is defined as an object, the content of the message payload returned by the dataSource that is merged to the model is determined by whether the type matches the widget type. If the type defined in the payload is the same as the widget type, then any matching model properties from the payload will be merged to the model. However, if the type field is omitted from the dataSource or does not match, then the url and iframeOptions are checked in the payload and merged into the model.

If the payload does not contain the type, url and iframeOptions fields, or the payload is not defined as an object, then no fields will be merged to the model.

DataSource Pipeline

DataSource Examples

The following sections are used to demonstrate examples of message payloads returned by the dataSource on the IFrame widget and the expected merge behavior when applied to the model.

Message payload, defined as an object, where the type field matches the widget type

Suppose that the dataSource on an IFrame widget returns the following message payload, where the type field defined in payload matches the widget type. In this case, any matching model properties from the payload will be merged to the model.

{
    "payload": {
        "type": "iframe",
        "iframeOptions": {
            "allowFullScreen": true,
            "loading": "lazy",
            "scrolling": "auto"
        },
        "toolbars": {
            "top": {
                "tools": {
                    "refresh": {
                        "type": "button",
                        "subType": "refresh"
                    }
                },
                "leftOrTop": {
                    "toolsOrder": [
                        "refresh"
                    ]
                }
            }
        }
    }
}

Message payload, defined as an object, where the type field is not defined but the iframeOptions and/or url field is specified

Suppose that the dataSource returns a message payload where the type field is not defined. In this case, the iframeOptions and url fields are checked for in the payload and if defined, these will be the only fields from the payload that are merged to the model. In the following example, only the url field is defined in the payload and so, this will be the only field merged to the model.

{
    "payload": {
        "captionBar": false,
        "url": "https://docs.inmation.com/release-notes/index.html"
    }
}

Message payload, defined as an object, where the type, iframeOptions and url fields are not defined

Let’s suppose that the message payload returned by the dataSource on an iframe widget does not contain the type, url and iframeOptions fields. In this case, no properties from the payload will be merged to the model.

{
    "payload": {
        "layout": {
            "w": 10,
            "h": 25
        },
        "toolbars": {
            "top": {
                "tools": {
                    "refresh": {
                        "type": "button",
                        "subType": "refresh"
                    }
                },
                "leftOrTop": {
                    "toolsOrder": [
                        "refresh"
                    ]
                }
            }
        }
    }
}

Similarly, if the payload is defined as an array or string, then no properties from the payload will be merged to the widget model.

Actions

The actions property of the IFrame widget model can be used to implement action pipelines for specific trigger events. The IFrame widget only supports the general widget action hooks, which can be found here.

Receive messages (Send Topics)

The IFrame widget can receive messages from other widgets. This widget only supports the general topics refresh and update.

Toolbars

The IFrame supports multiple custom toolbars. For information on configuring custom toolbars, see the toolbars section in the widget documentation.

Tools

Icon Name Description

Refresh Btn

Refresh

Refreshes the widget

Spacer

This tool is used to specify the spacing between tools in the widget toolbar. It can be customised using the style and styleByTheme properties.