MashZone NextGen 10.2 | Use dashboards | Configure dashboard components | Specify actions for dashboard components | Post data
 
Post data
The action creates an outbound API to pass data from MashZone NextGen dashboards to an embedding system, for example, an external web application.
The API data structure consists of the dashboard id, the specified external component id (URL-ID, see: Use dynamic URL selection), the selected coordinate names (columns), the selected coordinate values and the name of the event triggering the outbound data push. See the MZNG outbound data structure example below.
Procedure
1. Create a dashboard or open a dashboard in the dashboard editor.
2. Click an inserted chart component that supports actions. The relevant properties dialog is displayed.
3. Click the Action tab.
4. Select the action trigger event in the Trigger drop-down menu.
The available actions depend on the selected component.
5. Activate the Post data option.
If you deactivate the option the action will not be deleted but deactivated in view mode.
6. Click Configure to set the action configuration.
a. Select the coordinates that you want to add to the outbound data.
The coordinates selected are added to the outgoing data, that is displayed in the Outbound data preview box.
b. Click Save action.
Your settings are applied and your action is specified for the selected component.
MZNG outbound data structure
The outbound data is structured as follows:
{
"dashboardGUID": "d216bf4a-bd12-476d-aa5d-2a07a3efd4bf",
"outboundWidgets": [
{
"extId": "component2",
"outboundData": [
{
"name": "ARTIST",
"value": "Bob Dylan",
"type": "TEXT"
},
{
"name": "PRICE",
"value": "11.0",
"type": "NUMERIC"
}
],
"trigger": "onSelectionChange"
}
]
}
By triggering the Post data action, MashZone NextGen sends the configured outbound data using window.postMessage() events. In order to receive the events in an embedding system a listener function must be implemented as in the example below:
function listener(event){

// The origin of the window that sent the message
// at the time postMessage was called
// Format: protocol://host:port
var origin = event.origin

// A reference to the window object that sent the message
var source = event.source;

// The posted data object
var data = event.data;
}

if (window.addEventListener){
addEventListener("message", listener, false)
} else {
attachEvent("onmessage", listener)
}

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release