OpenWGA 7.10 - TMLScript reference

App
Method :

managedGlobal(name, designLocator[, config])

On object App
Usage Define a managed global for the specified Scope.
Description

This method typically is used inside the connect script of an App to define a "managed" global for this App usable inside all TMLScript blocks of the App under the specified name.

The global is "managed" because the system decides when to create a new object.

To do this managed globals have a "scope" that defines how often a new object is created by the system. In case of the default scope APP the global is created once for the App. in Case of CALL a new object is created for each request. Other scopes are SESSION, FORM and TMLPAGE.

Parameters

name (String)

The name of the global

designLocator (DesignLocator)

Address to the TMLScript module used for this global

config (Object - optional)

Use this parameter to specify the "scope" of the global and other config options. The default scope is WGA.Scopes.APP.

Examples

WGA.app().managedGlobal("Products", $.products, {

    scope: WGA.Scopes.APP

})

This defines a global with name "Products" using the TMLScript code from scripts/tmlscript/products.tmlscript.