I am using Tapestry 5.0.11 and have a problem with a dynamic list of strings in a form. What I am trying, is the following:

In the Page.java:

@Persist
private List<String> items;

@Property
private String item;

public List<String> getItems() {
        if (items == null) {
                items = new LinkedList<String>();
        }
        return items;
}

public void onSelectedFromAdd() {
        getItems().add("");
}

And in the Page.tml:

<t:form>
        <div t:type="loop" t:source="items" t:value="item">
                <t:textfield value="item" />
        </div>
        <div><t:submit t:id="add" value="more"/></div>
        <div><t:submit t:id="save" value="save"/></div>
</t:form>


I have a list of values, the user has to enter. The number of values, that have to be typed in, is dynamic, so the user has to extend the form. The add button works, but the values are not saved. Can someone tell me, that I am doing wrong?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to