So your container heirarchy is...

 Report
 - contains a Vector of ReportRow (called headerRow)
   - contains a Vector of ReportCell (called dataColumn)

Shouldn't this just be a matter of a couple of nested loops? Something like...


<s:iterator value="report.getHeaderRow()">
  <s:iterator value="getDataColumns">
    <s:property value="value"/>
  </s:iterator>
</s:iterator>

Does that (or the corrected syntax for that idea) not work?

For myself, I'd probably be tempted to *not* do the nested loop in the view and do it in the Report itself. Something like...

 public List getAllReportCells() {
   List allReportCells = new ArrayList();

   .. nested looping here adding each ReportCell to the list

   return allReportCells
 }

<s:iterator value="report.getAllReportCells">
  <s:property value="value"/>
</s:iterator>

--

This is all off the top of my head so don't expect a copy-and-paste of this to actually work. :-)

What's confusing you, specifically? Is it how to refer to a property of the action in the <s:iterator value""> part? Is it what to put in the "value" part of the property tag? Are you worried that the fact this is a Vector makes it not work with standard iteration techniques?

Seems like a very straightforward task, so I'm thinking that I'm not understanding what the problem really is.

- Gary

Justin Frost wrote:
I am having a difficult time figuring out a solution to my problem.

I think I will start out with my class structure first.  I only put in this
message what I thought was valuable.

public class Report implements java.io.Serializable {
        
        private java.lang.String title = "";
        private Vector headerRow = new Vector();  //Vector of ReportRow objects

        public Vector getHeaderRow() {
            return headerRow;
        }

        public String getTitle() {
            return title;
        }
}

public class ReportRow implements java.io.Serializable {
        
        private Vector dataColumns= new Vector(); // Vector of ReportCell 
Objects

        public Vector getDataColumns() {
             return dataColumns;
        }
}


public class ReportCell implements java.io.Serializable  {

        private String value;

        public String getValue() {
             return value;
        }
}

public class ReportAction extends ActionSupport{

        private ReportNew report;

        public ReportNew getReport() {  // This gives me access to "title"
                return report;
        }

        // I need some other getter to retrieve my "value" attribute
       // But I am unsure of how to go about it.

}

I want to use the <s:iterator> tag on "value".  Something like below.

        <s:iterator value="??????????">
                <th>
                        <s:property value="value"/>
                </th>
        </s:iterator>


I can not figure out what method I need in my Action class to allow the
values to be visible.
Can someone help me out.  Or is there a good example out there that I can
reference?

Thanks in advance.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to