OpenWGA 5.4 - WebTML reference

WebTML tags

<tml:option>

Description :
This tag specifies options which can be dispatched to any TML tag. Further it can be used by a TML tag to read options.

TML options are key value pairs. The name of the options is specified by the attribute "name". The value is either defined within the body of the <tml:option> tag or is computed by the attribute "expression".

As already mentioned this tag has to modes 'get' and 'set'. The mode can be specified explicit with the attribute mode or implicit. If the body of <tml:option> is empty and the attribute "expression" is not present the tag will be in mode 'get'. In the other case the 'set' option mode will be used.
Derived from: Attributes:
show inherited attributes ...
Name Value(s) Purpose
default defaultstring Sets a default string value to be returned when the option does not exist
defaultexpression TMLScript expression Calculate a default value by TMLScript that is to be returned when the option does not exist
expression TML script expression The result of the specified TML script expression will be used as option value.
mode get | set Defines the mode of the option tag.
name option name Specifies the name of the option to set or read.
scope global | local Specifies the scope of this option for included TML modules.

Examples:
A simple example which defines an option named 'color' and dispatches it to the TML include 'navigation':
<tml:include ref="navigation">
      <tml:option name="color">red</tml:option>
</tml:include>


<div style="background-color:<tml:option name="color"/>">
    ...
</div>