OpenWGA 7.10 - WebTML reference

WebTML tags » input

<tml:input 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.


A simple color selection box:
     _colors = createlist();

<tml:input name="color" type="select" optionsitem="_colors"/>

A more complex example with a selectbox showing all child documents of the current document:
    var docs = content().getStructEntry().getChildEntries();
    theOptions = createList();
    for (var idx=0; idx < docs.size(); idx++) {
        var doc = docs.get(idx);
        theOptions.add(doc.getTitle() + "|" + doc.getStructKey());

<tml:input name="subdocs" type="select" optionsitem="theOptions"/>