OpenWGA 5.4 - WebTML reference

WebTML tags


Description :
This tag defines input fields for WebTML forms.

It is the WebTML pendant to the HTML tags <input> and <select> offering various types of input fields and additional functions including validation and change-triggered WebTML actions.
Derived from: Only available in the following parent tags: Attributes:
show inherited attributes ...
Name Value(s) Purpose
changeaction TML action id Specifies an action which is automatically called when the field value changes
cleariferror fieldname1,fieldname2,... Specifies names of other TML form fields which should be truncated when the validation of the current field fails.
cssclass css class Specifies an css class for the input field
cssstyle css style definition Specifies a css style definition for this input field. The value is unmodfied rendered as HTML attribute "style" of the input tag.
default string Specify a default value for the field
defaultexpression tmlscript-expression Determines a default value for the field using TMLScript
encodeoptions true | false Activates or deactivates the automatic option encoding.
focus true|false Sets the focus to this input field.
hashedpassword Defines an input field for a password. Instead of the original value this field stores only the hashed value in the content document. The original value is not recoverable from these hash.
labeled true | false Wraps the option titles of type="checkbox|radio" inside HTML label tags
message validation message Defines the validation message for a specified validation expression.
meta true|false Specifies if the input field should be stored as meta or not. If meta is "true" the value given within the attribute "name" is interpreted as meta name.
mode edit|readonly|view Specifies the display mode of the <tml:input>.
multiple true|false Specifies on type="select" if the select box should allow multiple selections.
name item name Specifies the name of the item or if meta="true" the meta field whose value will be modifed by the input.
options option1[|value1],option2[|value2], ... Specifies predefined options for the input field.
optionsitem item name This is an alternative way to specify options for this input. The options can be specified by a list containing strings. Each entry defines the option and the corresponding value delimited by "|".
relationtype normal | protected Lets <tml:input> store relations instead of items
store true | false Specifies if this input should be persistent or not. None persistent fields will not be stored in the document by the tmlform.storeIn..() methods.
type="boolean" boolean Creates an input field for a boolean value.
type="file" file Provides an upload dialog for a file attachment.
type="number|date" number|date Provides an input field for number or date values.
type="select|checkbox|radio" select Provides an input field for list values. The attribute 'options' defines the comma separated values for the field. The attribute 'multiple' defines if multiple selections should be possible or not.
type="text|password|hidden" text|hidden|password Creates a standard HTML text input field. For type="password" the characters will be marked. For type="hidden" the whole field will not be visible in the ui.
type="textarea" textarea Provides a multi line text input field. The corresponding HTML type is "textarea". The HTML attributes "rows" and "cols" can be specified in the body of the TML input tag.
validation TMLScript expression Specifies a validation expression which will be evaluated when the TML form is stored.
validationdivider divider Specifies a divider to separate multiple validation rules and their corresponding messages.

While it is theoretically possible to use plain HTML inputs inside WebTML forms you should prefer inputs rendered by this tag as it not only provides additional functionality but also security. WebTML forms for example monitor the WebTML inputs that were registered for them and will not accept additional inputs that are posted (unless it is explicitly allowed via the htmlinput attribute).

This tag is derived from <tml:[All action calling tags]> because it is able to call a WebTML action on data change when attribute changeaction is defined. It accepts all attributes from there except form which does make no sense here and param1...param5 because the parameters used on this action are predefined (see changeaction for details).
A custom form demonstrating some field types.
<tml:form id="aForm">
    File upload<br>
    <tml:input type="file" name="aFileupload">size="80"</tml:input><br>

    <tml:input type="text" name="aTextField"/> <br>

    <tml:input type="checkbox" multiple="true" name="aCheckBox" options="red|1, green|2, blue|3"/><br>

    <tml:input type="boolean" name="yesNo"/> <br>

    <tml:input type="textarea" name="aTextArea"/> <br>