OpenWGA 7.6 - WebTML reference

WebTML tags » input

<tml:input optionstitle ="tmlscript-expression">

Purpose:

Calculates option titles for option values

Description:

This attribute can be used in two ways:

When used together with options and optionsitem it can calculate titles for custom option values. If the options given by those attributes do not contain titles then the expression in optionstitle will be used to calculate one. The current option value then is retrievable as variable $O_VALUE inside the expression.

It also can be used for relations declared by HDBModel. In that case the expression is executed with target documents in context.

In both cases the expression result is used as option title for the given option.

Value(s):

A TMLScript expression

Examples:

Usage of optionstitle with custom values, where the titles are retrieved from labels. It will retrieve labels "usage.full", "usage.limited" and "usage.none":

<tml:input name="usage" type="select" options="full,limited,none" optionsitem="label('usage.' + $O_VALUE)"/>

Usage of optionstitle for a relation. The title is calculated as the target documents title plus its key in brackets:

<tml:input name="category" type="select" relationtype="normal" optionstitle="TITLE + ' (' + KEY + ')'"/>