Thanks Anthony. The caseDate is a string and my intention is to write out
" " where the caseId is repeated. I believe all the logic has to go in
the jsp, since it is just a presentation issue (perhaps I am wrong though).
This what my jsp looks like now...
<% String a="0";%>
<logic:iterate id="echaResults" name="phsEchaSummaryForm"
property="echaResults">
<logic:notEqual name="echaResults" property="gcsiId" value="<%=a%>">
<% a=<bean:define name="echaResults" property="gcsiId"/>%>
<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="<%=a%>">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </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>
</logic:iterate>
The line:
<% a=<bean:define name="echaResults" property="gcsiId"/>%>
does not compile. Is there a way of assigning the value of gcsiId to a
variable - a - so that I can do the comparison?
Thanks
Steve
-----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 " " (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