On Load Processing
You can set global values (master data) when the screen opens or when the widget page loads. These values are available for use in subsequent processing on the screen.
There are 2 types of On Load Processing for a widget:
1. Before Data Load Script
In this script, you can set the following data:
All the master data or data that is to be set once for the page.
Initialize the data hash map where data from the screen is stored.
This script is executed before a widget is loaded and data loaders are invoked.
Data hash map and master data can be set as follows:
Create one widget and set the property Data Mapping > Data Bean Path =
widgetpath. You can set any name. For creation of widget and setting properties to it, see CREATE WIDGET.Write the following script in the property On Load Processing > Before Data Load Script:
data.widgetpath = utils.createMap(); data.widgetpath.field1 = "aaa"; data.widgetpath.field2 = "bbb";Click SAVE.
You can use these values as master data in any of the scripts or actions defined in your widget as follows:
var sumoffields = data.widgetpath.field1 + data.widgetpath.field12;
2. After Data Load Script
This script is executed after the widget is loaded and data loaders are invoked.