OpenWGA 7.0 - TMLScript reference

WGA
Method :

createList()
createList(array)
createList(liststring, delimiter)

On object WGA
Usage Creates a new List object
Description There are three variants that differ by the data that is initially added to the list:

Variant 1: Creates an empty list

Variant 2: Takes the elements from an array, either a JavaScript or Java array, and puts them into a new list

Variant 3: Takes the string representation of a list, with single values delimited by some substring like a comma, semicolon. The parameters specify the list string and the delimiter. The new list ist initialized with the single values from the list string.

For backward compatibility there still is a method "createList()" available on TMLContext whose use is discouraged since OpenWGA 5.3.

Parameters array (Array):
Variant 2: Array whose elements are added to the list

liststring (String):
Variant 3: String containing single values delimited by a special substring

delimiter (String):
Variant 3: The delimiter substring used in parameter "liststring"
Return value A new List object
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples

Using the array from this.cookies to create a list:

var cookiesList = WGA.createList(this.cookies);

Here a list string containing city names, delimited by commas, is used to feed the list:

var cityList = WGA.createList("Munich,Madrid,London", ",");

The result is a list of three elements:

"Munich"
"Madrid"
"London"