OpenWGA 5.4 - TMLScript reference


Object:

Liste

Description A list represents a dynamic amount of single values that have a defined order and are accessible via index  numbers. Lists have a dynamic size. Elements can be added, inserted and deleted from the list. Their functionality is mostly equal to JavaScript arrays. They are effectively the TMLScript representation of the Java interface java.util.List.

The index numbers of lists are zero based. The first element of the list has index number 0.

Lists are used at most places in TMLScript where some kind of multiple value field is concerned.. They can contain any value or object, even values and objects of mixed size, although this is not recommended.
Retrieval Diverse methods in TMLScript, but especially:

WGA.createList()
this.itemList()
this.metaList()
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
    portletevent
Properties and methods
Name Purpose
list.add([index, ] wert) Adds a value to the list
list.addAll([index,] list) Adds all values of another list to this list
list.clear() Removes all values  from the list
list.contains(wert) Controls if a value is contained in the list
list.containsAll(list) Controls if this list contains all values of another list
list.equals(list) Tests two lists for equality
list.get(idx) Reads a value from the list
list.indexOf(wert) Returns the index position of a value in the list
list.isEmpty() Controls if the list is empty
list.lastIndexOf(wert) Returns the (last) index position of a value in the list
list.remove(wert)
list.remove(idx)
Removes a value from the list
list.removeAll(list) Removes all values from the list that are contained in the parameter list
list.retainAll(list) Removes all values from the list that are not contained in the parameter list
list.set(idx, wert) Sets a value at an index position
list.size() Returns the number of values in the list
list.subList(from ,to) Extracts a partial list
list.toArray() Creates a JavaScript array containing the list values