OpenWGA 5.4 - TMLScript reference

Lists
Method :

list.toArray()

On object Lists
Usage Creates a JavaScript array containing the list values
Description Use this method to convert a list to an array, to be able to perform array operations on it.

The new created array is independent of the list. It can be modified without influencing the list.

The method WGA.createList() with array parameter can be used as backconvert functionality. It takes a JavaScript array and transforms it into a list again.
Return value Javascript-Array
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
    portletevent
Examples This method can be used to utilize the array processing functions that are available in TMLScript with lists. For example the elegant iteration methods on the array object that are defined in JavaScript 1.6:
list.toArray().forEach(
  function(val) { log.info("Value: " + val); }
);