Vic Seedoubleyew
Vic Seedoubleyew

Reputation: 10556

Select with dynamic list of options with TeaVM Flavour

I am trying to set up a select dropdown menu, using TeaVM Flavour HTML templates.

While the doc mentions how to do it with a static list of options, it doesn't show how to handle a dynamic list of options.

Upvotes: 2

Views: 77

Answers (1)

Vic Seedoubleyew
Vic Seedoubleyew

Reputation: 10556

The trick is to use html:value, which applies both to <input> tags as well as <option> tags:

<select name="mySelect" html:bidir-value="myResult">
    <std:foreach var="myOption" in="myList">
        <option html:value="myOption">
            <html:text value="myOption"/>
        </option>
    </std:foreach>
</select>

Upvotes: 2

Related Questions