On Friday 12 September 2008 16:18:02 Jeromy Evans wrote:
> Roger wrote:
> > Hi
> >
> > I'm trying to get indexed lists working so that I can get any amendments
> > back into my model. At the moment I've got
>
> In the last line, did you confirm that count has the correct value?
Yes, I've confirmed that count has the right value. At the moment the list has
three entries pre-loaded in my action which numbered 0,1 &2 by the iterator
and the count evaluates to 3.
> What if the list is empty? (in that case count has never been set)
>
Good point :-(
Running with an empty list evaluates to valuables[] in the html
>
> <s:textfield name="valueables[%{#count}].text" value="%{text}"/>
>
> The issue could relate to how valueables is being constructed. Are you
> creating it, or leaving it to the framework to create it? It should be
> able to add extra elements to a list
>
Doh!!! I had valuables as an inner class of my model class. Moving the code
into a separate class and lo & behold I can now add to the list when it's
pre-populated
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]