OpenWGA 7.6 - 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 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 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.
html_attribute html-value Defines a custom HTML attribute that will be added to the generated HTML input tag
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 if the input should allow multiple values
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 attributes names an item or WebTML variable which contains a list defining the options to use.  Each list element defines one option. You may specify option values only or option title and option value divided by a pipe symbol "|".  If you do not specify titles you may also let them be calculated by attribute optionstitle.

If you want WebTML to automatically retrieve options for a HDBModel relation then you need to omit both attributes options and optionsitem.

optionstitle tmlscript-expression Calculates option titles for option values
relationtype normal | protected Lets <tml:input> store relations instead of items
sortoptions [value,]asc | desc Sorts the options of this input
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="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.
type="number | date" number|date Provides an input field for number or date values.
type="select | checkbox | radio" select Provides an input field for choosing predefined values
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.
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>