struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arron Bates <arr...@pacific.net.au>
Subject Re: iterate tag with nested collections?
Date Wed, 13 Feb 2002 03:42:54 GMT
You can get the basic iterate tag to "view" the data, but it wont update 
within a form.

Go here...
http://www.keyboardmonkey.com/struts

...there's a turorial and examples that will take you through the system 
and get you nesting lists in no time.
The tags this page is on about is in the Struts nightly build, so it 
will be in the next release of struts.
100's of people use it for just this problem (it's also the main reason 
why it was made!).

Arron.

MacKellar, Kimberly wrote:

>If I understand your structure correctly, something like the following
>should work
>
><strutslogic:iterate id="a" name="newBusinessActivityForm"
>property="report.Level1" >
>
>   <br><strutsbean:write name="a" property="agentName"/></a>
>
>      <strutslogic:iterate id="b" name="a" property="Level2" >
>        <br>Insured Name:  <strutsbean:write name="b"
>property="insuredName"/></a>
>      </strutslogic:iterate> 
>         
></strutslogic:iterate>
>
>
>Kim MacKellar
>
>
>-----Original Message-----
>From: Michelle Popovits [mailto:Michelle.Popovits@worldinsure.com]
>Sent: Tuesday, February 12, 2002 3:31 PM
>To: Struts-User@Jakarta. Apache. Org (E-mail)
>Subject: iterate tag with nested collections?
>
>
>Hi,
>
>I am trying to add a multi-level report to a struts application.
>So the report structure will be like this:
>
>Top Level Details................................
>Level 1 Details .....................................
>   Level 2 Details..................................
>   Level 2 Details..................................
>   Level 2 Details..................................
>   Level 2 Details..................................
>Level 1 Details .....................................
>   Level 2 Details..................................
>   Level 2 Details..................................
>Level 1 Details .....................................
>   Level 2 Details..................................
>   Level 2 Details..................................
>   Level 2 Details..................................
>   Level 2 Details..................................
>Level 1 Details .....................................
>   Level 2 Details..................................
>   Level 2 Details..................................
>
>
>I have set up my Value objects like so:
>
>ReportVo (top level)
>inside the ReportVo I have a collection of Level1Vo value objects
>inside each instance of Level1Vo I have a collection of Level2Vo value
>objects. 
>
>This info is passed into my struts jsp page.
>I am able to show attributes in the top level (ReportVo) and the 1st level
>(Level1Vo) value objects just fine.
>My problem now is to get the Level2Vo value object attributes to show up.
>
>
>Here's a hacked sample of the jsp.  What I am trying to figure out is how to
>get the nested iterate tag to work.  Each Level1 value object contains a
>collection of Level 2 objects.
>
>
><strutshtml:form action="newBusinessActivity.do"
>name="newBusinessActivityForm"
>type="com.worldinsure.admintool.report.struts.NewBusinessActivityForm"  > 
><p>
>Top Level:
><br>Total Number of Submitted Applications:  <strutsbean:write
>name="newBusinessActivityForm" property="report.submittedCount"  />
><br>Total Face Amount: <strutsbean:write name="newBusinessActivityForm"
>property="report.faceAmtTotal"  />
>
><p>
>1st Level
><p>
><strutslogic:iterate id="a" name="newBusinessActivityForm"
>property="report.Level1" >
>
>   <br><strutsbean:write name="a" property="agentName"/></a>
>
>      <strutslogic:iterate id="b" name="newBusinessActivityForm"
>property="report.Level1.Level2" >
>        <br>Insured Name:  <strutsbean:write name="b"
>property="insuredName"/></a>
>      </strutslogic:iterate> 
>         
></strutslogic:iterate> 
>
></strutshtml:form>
>
>Any thoughts on if this could work using struts tags or do I need to resort
>to java code?
>
>Thanks,
>Michelle
>
>--
>To unsubscribe, e-mail:
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail:
><mailto:struts-user-help@jakarta.apache.org>
>
>--
>To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
>
>



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


Mime
View raw message