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.
requestName-
Name of the function to be called.
request-
Depending on the function, this attribute specifies a parameter object that contains additional data.
sourceId-
Freely selectable ID. This is transmitted as `
destinationId` when the function result is sent. This allows the caller to uniquely identify the result.
Function Result
The result of the function call is transmitted asynchronously via Window.postMessage to the page embedding
.
{
"requestName": "METHOD_NAME",
"request": {
"_comment": "optional request object"
}
}
{
"requestName" : "METHOD_NAME",
"destinationId" : "SAME_AS_SOURCE_ID",
"response" : {
"_comment": "optional response object"
}
}
Functions
The following functions are available.
- setFormConfig
-
Sets the form configuration.
- getFormConfig
-
Retrieves the form configuration, including the current state (admin/formconfig.adoc#state).
- setData
-
Sets the data in the state object.
- validateData
-
Triggers admin/validation.adoc.
- submitData
-
Triggers Submit - Form Submission
- resetForm
-
Triggers Reset - Reset Input
- printForm
-
Triggers Print - Print the form as a PDF