úterý 1. prosince 2015

Coach View - access to Coach Viev configuration parameter in JavaScript

Assume that the coach view configuration has a parameter named color:

Here is the JavaScript code to access the confirguration:

var color
color = this.context.options.color.get("value");




Coach View - how to change a button text and text color in JavaScript

var button;
button = this.context.element.getElementsByTagName("button")[0];
button.firstChild.data = "A new text";

// set the button text color
// using AMD dependency dojo/dom-style alias domStyle
domStyle.set(button,{"color" : color});

Coach View - how to access a localized resource from JavaScript

A process app or toolkit can define one or more Resource Bundle Groups (under User Interface in Process Designer). The defined resources are accessible via following Javascript code:

tw.resource.<resource bundle group name>.<localization key name>