struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michelle Popovits <Michelle.Popov...@worldinsure.com>
Subject iterate tag with nested collections?
Date Tue, 12 Feb 2002 21:30:39 GMT
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>


Mime
View raw message