OpenWGA 7.10 - WebTML reference
WebTML tags » script<tml:script expression ="expression">
Purpose:
Description:
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".
<tml:script>
return 'The result is ' + x;
</tml:script>
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.