Apps and development tools - Basic App Kit

AppKit Modules

<tml:include ref="form-field@base">

Since version 2.1.0

Description :

Generates a <div> structure that typically contains a label and an input field.

In addition the module automates error handling for field inputs

Options:

All options are optional.

<tml:input> attributes:

Most attributes from <tml:input> can be specified as option:

name, type, format, multiple, meta, options, validation, message, default, changeaction, focus, store, relationtype

To generate an input field at last option "name" must be specified. Otherwise no input field is generated.

For type="date" a datepicker will be rendered. You should not define your own format because the format will automatically detected based on the browser locale.

For type="textarea" an autogrow function will be added to the textarea.

For relationtype="normal | protected" a selectbox is rendered that provides valid options as specified in the HDBModel. If a relation is defined as group="true" in the model, a multi select control is rendered. If optional="false" is specified in the model, a default validation is generated.

In addition to standard input type a special type="image" is available. This can be used to select an images from the attachments of the current content.

field:

This option can be used if you use form-field without a name option and add your own <tml:input> inside the body. Validation errors of tmlform field [field] will be highlighted the same way as on other form-fields then.

See example above.

placeholder:

Adds a placeholder HTML attribute to the input field.

attributes:

defines custom HTML input attributes added to the input field

typeahead:

if specified a bootstrap typeahead function is generated. The value of this option is taken as URL to be called when the user types. The called URL should return the available values as JSON as documented in bootstrap.

body:

Option "body" if defined is rendered inside the <div> structure. If an input field is generates (option "name" defined) the body is rendered after the generated <tml:input> field.

Examples:


<tml:[form-field@base] o_label="your name" o_name="name"/>

The module can also be used to create custom contents in the overall form-field layout:

<tml:[form-field@base] o_label="custom field" o_field="my_field">

    <tml:input name="my_field" .../>

</tml:[formfield@base]