Embedded Mode (iFrame)

The renderer can be embedded in other applications via an iFrame and controlled through it. Window.postMessage is used to communicate with the renderer in the iFrame. https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage All Functions also send responses via this method to the application that embeds the renderer via an iFrame.

Function call

A serialized JSON object is passed as the message parameter.

action

Name of the function to be called.

payload

Depending on the action, this attribute specifies a parameter object that contains additional data.

sourceId

Freely selectable ID. This is transmitted as destinationId when the function result is returned. This allows the caller to uniquely identify the result.

Function Call Structure
{
  "action"  : "METHOD_NAME",
  "sourceId": "SOURCE_ID",
  "payload" : {
    "_comment": "optional object depending on method"
  }
}

Function Result

The result of the function call is transmitted asynchronously via Window.postMessage to the page embedding ` `.

Function Result Structure
{
  "success"  : "SUCCESS_OF_ACTION",
  "action"   : "METHOD_NAME",
  "destinationId" : "SAME_AS_SOURCE_ID",
  "response"      : {
    "_comment": "optional response object"
  }
}

Functions

All actions valid in the Forms context can be used. For example:

{
  "action"  : "setFormState",
  "payload" : {
    "data"  : { "welcomeMsg"  : "Dies ist eine neue Nachricht" }
  }
}

With the response indicating that the function was successfully called:

{
  "success" : true,
  "action"  : "setFormState",
  "destinationId" : "*",
  "response": {}
}

Keywords: