The Chart example the plotValues property is persisted:
<page-specification class="org.apache.tapestry.workbench.chart.ChartPage"> <property name="plotValues" persist="session"/> ....... I am assuming you are not persisting since from your logs: 9627410 [btpool0-3] INFO com.example.pages.Home - Begin render. Rewind? true 9627411 [btpool0-3] INFO com.example.pages.Home - Initializing names list The list gest reinitialized on each request. I think you may be misunderstanding the @For loop. @For inside a form will not create a List or populate it for you. @For works with an existing list and in your case the existing list is a new list on each beginRender. @For then iterates over an empty list which means nothing inside it will ever get executed (all your form input fields never get rewound). The keyExpression is used only to verify that the list that you are working with has not changed since you rendered the page. In your case it HAS! When you rendered the page originally your list had a blank name in it. On the rewind it has no elements. Maybe tapestry should be smarter and throw an error when the size of the list doesn't match the size from when it was rendered. On 1/10/07, Jim Downing <[EMAIL PROTECTED]> wrote:
Hi Jesse, Jesse Kuhnert wrote: > I think the problem with this approach is that the For component has > no way of uniquely identifying your list values. > > I would try using the keyExpression or converter parameters of the For > component to do this instead. > http://tapestry.apache.org/tapestry4.1/components/general/for.html Thanks for the pointers, but I'm still having problems, using either a custom converter or a keyExpression (using "toString()"). As I understand it either of these methods rely on there being a single reference to the object that doesn't change between requests. This obviously doesn't exist for value objects. What I'm finding confusing is that this looks to me just like the example in the charts pane of the tapestry workbench demo; there a list of PlotValues is edited without keyExpresssion or a converter. Why is this different? Would a reasonable hack be to bind the value of the text field input to a property with a concrete setter that used the @For index to build the new list items manually? Thanks, jim --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]