You have gotta love the mail archive. The following item answered all my
questions:
http://www.mail-archive.com/[email protected]/msg09813.html

Now my code looks like the following:

  <% String s = "0"; %>
  <logic:iterate id="echaResults" name="phsEchaSummaryForm"
property="echaResults">
  <bean:define id="tempId" name="echaResults" property="gcsiId"/>
      <logic:notEqual name="echaResults" property="gcsiId" value="<%=s%>">
      <td><bean:write name="echaResults" property="gcsiId"/></td>
            <td><bean:write name="echaResults"
property="gcsiCaseDate"/></td>
            <td><bean:write name="echaResults"
property="ghaDescriptionL1"/></td>
            <td><bean:write name="echaResults" property="guUserCode"/></td>
            <td><bean:write name="echaResults"
property="pechaComments"/></td>
      </logic:notEqual>
      <logic:equal name="echaResults" property="gcsiId" value="<%=s%>">
      <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
      </logic:equal>
            <td><bean:write name="echaResults"
property="gccDescriptionL1"/></td>
            <td><bean:write name="echaResults"
property="gcCodeArgument"/></td>
            <td><bean:write name="echaResults"
property="gcExpandedResultL1"/></td>
  <% s = (String) pageContext.findAttribute("tempId"); %>
  </logic:iterate> 


-----Original Message-----
From: Anthony Martin [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 29, 2001 11:44 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Using the <logic:equal> tag in collection


Why not make this a function of the perform() method?  Is caseDate a String
or Date?  If it's a String, just assign "&nbsp;" (if it's in a table) or ""
(if it's not).  If it's a Date, assign something like "01/01/1980" then test
for it with <logic:equal> in the JSP.


Anthony

-----Original Message-----
From: Steve Taylor [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 29, 2001 10:22 AM
To: Struts-User (E-mail)
Subject: Using the <logic:equal> tag in collection


I am using the iterate tag to display the results from a query to a
database.

<logic:iterate id="echaResults" name="phsEchaSummaryForm"
property="echaResults">
    <td><bean:write name="echaResults" property="id"/></td>
    <td><bean:write name="echaResults" property="caseDate"/></td>
    <td><bean:write name="echaResults" property="gccDescription"/></td>
    <td><bean:write name="echaResults" property="gcExpandedResult"/></td>
</logic:iterate> 

This produces result in the following manner:

1   4/2/2000    First description for 1     An expanded result for 1
1   4/2/2000    Second description for 1    Another expanded result for 1
1   4/2/2000    Third description for 1     And another expanded result for
1
2   5/30/2000   First description for 2     An expanded result for 2
2   5/30/2000   Second description for 2    Another expanded result for 2

The problem I am having is that I do not want to display the id and caseDate
unless they change (the last two columns are essentially a subquery). I
would rather display it in the following way:

1   4/2/2000    First description for 1     An expanded result for 1
                     Second description for 1    Another expanded result for
1
                     Third description for 1     And another expanded result
for 1

2   5/30/2000   First description for 2     An expanded result for 2
                      Second description for 2    Another expanded result
for 2

To do this I will probably need to use <logic:equal name="echaResults"
property="id">, but I am just not certain how I would store the previous id
in a temporary variable. 

Any suggestions or ideas would be greatly appreciated.


> Steve Taylor
> Systems Consultant
> Pangaea Systems Inc.
> (250) 360-0111
        http://www.pangaeainc.com

Reply via email to