You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by boukovska <bo...@yahoo.co.uk> on 2004/09/30 13:38:43 UTC

Repost: Iterate through nested Map and set values

Hi all
I have a problem with setting the values on a hierarchy of nested
properties.
I have an ActionForm which has a property A of type HashMap. A is 
keyed
on
Strings, and each value of A is a Collection (ArrayList). This
collection
contains objects of type B.
I am trying to iterate through the keys A, and for each key, iterate
through
the corresponding value (which is an ArrayList of B objects). The I 
want to display a property of
B
and let the user change it. I am able to display the properties of
object B
on the screen. However, for some reason the <nested:text> tag doesn't
work -
the textbox is there, but the input does not populate the form.
The following is what I am trying to do.
<nested:iterate id="idForA" property="A">
<nested:iterate name="idForA" property="value"> <!--this should access
collection of B objects -->
<nested:text property="foo"> <!--allow user to enter a
property of B -->
</nested>
</nested>
</nested>
The problem is that when I enter a new value for foo, nothing happens;
the
value of the nested property is not set. Is it possible to iterate 
through a
HashMap, and let the user update its values?
I am quite new to Struts, and have spent a lot of time trying to get
this to
work, but no luck. Any help will be appreciated!
Thanks
Danielle



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org