OpenWGA 7.9 - TMLScript reference

TMLForm "tmlform"
Method :

setField(name, value)

On object TMLForm "tmlform"
Usage Sets the value of a field
Description The field is created if it does not yet exist. Else the value of the existing field is updated.

If you want to issue multiple values use a List of values as value parameter.

Fields created by this method can be put out in WebTML by <tml:input> tags like usual, so this method can be used to initialize field values.

However they do not need to be put out in WebTML to stay on the form. You may create a field with this method that is nowhere displayed but which is automatically transported in form postings, therefor still available in subsequent requests (even if the form is not persistent). These "displayless fields" are a good alternative to "hidden" fields because there is no way they can be modified by the browser user.
Parameters

name (String):
Name of the field to set (String)

value (Object):
Value of the field. Use a single value or a list of values

Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
    portletevent