You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Newton <ne...@yahoo.com> on 2007/01/21 06:42:17 UTC

[s2] Forms with map of beans with lists of beans...

...I think I stopped at the right place in the
subject.

I have a map of beans, the beans have a list of other
different beans. I'm struggling to make this work with
the auto-type conversions (various errors depending on
how I set things up; currently getting an NPE, have
gotten many other spectacularly long-winded stack
traces).

I'm wondering if this is doable or if I should just
create accessors in my Action to get to this lists
directly, or if there is some
MyAction-conversion.properties magic I can do to make
it all work.

My current MyAction-conversion.properties file looks,
more or less, like this:

Key_exDataMap=java.lang.Long
Element_exDataMap=foo.ExData

Element_list1=foo.model.TheData
CreateIfNull_list1=true

In the JSP:

    <s:textfield
name="exDataMap[%{#exData.id}].list1[0].field1" />

So I have exDataMap = Map<Long, ExData>
ExData has list1 = List<TheData>
TheData has Long field1

Now I know the _list1 stuff is nested within the map,
but something else I did several months ago led me to
believe that it worked (but I might have solved that
some other way; I no longer recall).

TIA,
Dave




 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

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