OpenWGA 7.11 - OpenWGA Concepts and Features
Design and development » TMLScript » Items, metadata and variables in TMLScriptItem Expressions
In OpenWGA before 7.2 when using <tml:item name="someName"/> OpenWGA tried to retrieve the item value as follows:
Values of WebTML variables (local vars, session vars, portlet vars) by variable name
Values of mapped item values
Values of Content Items
In OpenWGA 7.2 (with designs of version compliance 7.2 or higher or if publisher option "Enable enhanced item expressions(WebTML.EnhancedItemExpressions)" is specified as true) items are treated as "item expressions":
- String literals surrounded by ' : 'some text'
- Number literals by simply specifying the number: 1, 1.5, -1
- Boolean literals: true, false
- Other literals: null, undefined
- if item name begins with $:
- The current portlet controller: $pc
- The current module controller: $mc
- Other $-value replacements ($option_<name>, $item_<name>, ...)(see Parameter injection)
- Values of WebTML variables by variable name
- Values of mapped item values
- Values of Content Items
Samples:
<tml:item name="$mc.someMethod"/>
<tml:item name="$option_customer"/>
<tml:item name="$urlParam_search"/>
<tml:item name="$field_customer"/>
In addition for each non-literal you can append "call chains" to the name, i.e. retrieve properties or call methods on the returned value object using the dot "." as divider. For example:
<tml:script>
// if you still use script inside TML ...
_contact = { name: "walter", lastname: "matthau"};
</tml:script>
<tml:item name="_contact.lastname"/>