Howard,
Thanks a lot for responding. I tried setting the volatile="true" for
the Loop component, but i still have the same issue. When i try
printing the first element of the ArrayList on the onSuccess method,
it still shows the old value.
Start.html
------------------------------------------------------------------------
----------------------
<span t:type="form">
<span t:type="Loop" source="values" value="value" volatile="true" >
<span t:type="textfield" value="value"/>
</span>
<span t:type="submit"/>
--------------------------------------------------------------------
Start.java
------------------
public class Start
{
@Persist
private ArrayList<String> values;
private String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@SetupRender
public void fillValues()
{
System.out.println("fillvalues------------");
values = new ArrayList<String>();
values.add("test");
values.add("test1");
this.setValues(values);
}
public ArrayList<String> getValues() {
return values;
}
public void setValues(ArrayList<String> values) {
this.values = values;
}
String onSuccess()
{
System.out.println(this.getValues().get(0));
return null;
}
}
Anjana Gopinath
True North Technology
On Apr 5, 2007, at 10:18 AM, Howard Lewis Ship wrote:
This should work, but it looks like you simplified your example.
The Loop component records into the form (as hidden fields) the values
from its source parameter. When the form is submitted, it uses these
values, and ignores it source parameter.
In the short term, you should be able to get the Loop and Form combo
to work by turning on the volatile parameter of the Loop. In the long
run, you should provide a PrimaryKeyEncoder to the Loop, to guide it
in how to serialize the dynamic data into the Form.
On 4/5/07, Anjana Gopinath <[EMAIL PROTECTED]> wrote:
Hi,
I am trying to iterate over a list and display the values in a
textfield. User can edit these values and i need to save these back
to the list. I am able to display all the values, but the values are
not getting updated when user saves them.
<span t:type="form">
<span t:type="Loop" source="values" value="value" >
<span t:type="textfield" value="value"/>
</span>
<span t:type="submit"/>
</span>
Is this possible ? i searched in the mailing lists, but couldnt find
any information.
Thanks
Anjana Gopinath
True North Technology
--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]