struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mpopovits.rm" <michelle.popov...@worldinsure.com>
Subject Re: iterate tag with nested collections?
Date Wed, 13 Feb 2002 15:04:00 GMT
Yeah, that worked.
Thanks.
--- In struts@y..., "MacKellar, Kimberly" <Kimberly.MacKellar@t...> 
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@w...]
> 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@j...>
> For additional commands, e-mail:
> <mailto:struts-user-help@j...>
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@j...>
> For additional commands, e-mail: <mailto:struts-user-help@j...>


--
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