OpenWGA 7.7 - TMLScript reference

TMLContext "this"
Method :

setVar(varname, wert)

On object TMLContext "this"
Usage Creates or updates a (normal) WebTML variable
Description This is the TMLScript pendant of WebTML attribute var. It sets or updates normal WebTML variables whose scope is the current WebTML request. As all WebTML variables they can be retrieved by this.item() in TMLScript or <tml:item> in WebTML.

There is a shortcut syntax for setting normal WebTML variables documented on the TMLContext object itself.
Parameters varname (String):
Name of the variable to set

wert:
Value of the variable to set
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples Setting a variable in full syntax:

this.setvar("myCityPreference", "Ratingen");


Using the shortcut syntax, once with qualifying "this", once without. Both lines work the same:

this.myCityPreference = "Ratingen";
myCityPreference = "Ratingen";