OpenWGA 7.9 - WebTML reference

WebTML tags » script

<tml:script expression ="expression">


Alternative definition of the expression to execute


This attribute can be set alternatively to the definition of the executable expression in the tag body.

The difference to conventional working method of using <tml:script> is for expression languages which make a difference between an expression and a script, similar to tmlscript.

TML-Script-scripts are code blocks with control statements and code flow, as normally used in <tml:script>. The result of a TML-Script must be returned by the command "return".

    return 'The result is ' + x;

TML-Script-expressions in Web-TML are used generally to determine conditions. They consists of operations and datafields instead of control statements. The result of a TML-Script-expression is simply computed out of datafields and operations. The attribute "expression" enables you to compute the result of the tag over a TML-Script-expression.

<tml:script expression="'The result is ' + x"/>

This is generally shorter and mor readable if the script does not have any flow of control but just returns data fields combined with operators.


Any TMLScript  expression