OpenWGA 7.1 - WebTML reference

WebTML tags » input

<tml:input changeaction ="action-id">

Purpose:

Specifies an action which is automatically called when the field value changes

Description:

This works on input types select, checkbox, radio and boolean. The parameters on this action call cannot are predefined and cannot be determined in code. The change action receives the name of the select field that triggered the changes as parameter 1.

Examples:

An example where an input of type "select" triggers an action "change" when its data changes. Constructs like these are often used when a part of the form is dependent on some general choice, like in this example. When the contents of fiedl "country" changes this triggers an action which will store the current value in a variable. Based on this variable the form shows different inputs, which will be displayed at once as the called action will also refresh the form:

<tml:action id="change">
    setSessionVar('country', tmlform.country);
</tml:action>

<tml:form id="chooseCountryAndCity">
    Country: <tml:input type="select" name="country" options="-|-,Germany|de,Austria|at,Swiss|ch" changeaction="change"/>
    <hr/>           
    <tml:select switch="country">
        <tml:case value="de">
        City: <tml:input type="select" name="city" options="Berlin,Munich,Cologne"/><br/>
        </tml:case>
   
        <tml:case value="at">
        City: <tml:input type="select" name="city" options="Vienna,Salzburg,Graz"/><br/>
        </tml:case>
   
        <tml:case value="ch">
        City: <tml:input type="select" name="city" options="Zurich,St. Gall,Bern"/><br/>
        </tml:case>
    </tml:select>

</tml:form>