I am using an iterate tag to iterate over a List of items that have a given
category.  I need to be able to determine when a given category has changed
when iterating and push out a header row in a table that I am generating.
Is there a way that I can look back a row or save the category from the
previous row so that I can compare it with the current row to determine
whether or not a category break has occurred.   Here is a snippet of my
code:


<%
String previousCategory = "<empty>";
%>

<table width="100%" border="1" cellspacing="0" cellpadding="3"
frame="hsides">
        <tr>
                <th align="left" nowrap>Filename</th>
                <th align="center">Description</th>
        </tr>
        <logic:iterate id="currElement" name="dbFileBean" property="records"
indexId="index">
                <logic:notEqual name="currElement.categoryName"
value="<%=previousCategory%>">
                        <tr>
                                <td colspan="6"
class="groupBreak"><b><bean:write name="currElement"
property="categoryDesc"/></b><a name="<bean:write name="currElement"
property="categoryName"/>"></a></td>    
                        </tr>
                </logic:notEqual>
                <tr bgcolor="<%=colors[index.intValue()%2]%>">
                        <td align="left" nowrap><img
src="/images/common/spacer.gif" width="15" height="10">
                                <a
href="documentsandfiles?fileId=<bean:write name="currElement"
property="fileId"/>"><bean:write name="currElement"
property="fileName"/></a>
                        </td>
                        <td align="left">
                                <bean:write name="currElement"
property="description"/>
                        </td>
                </tr>
                <% previousCategory =
((DbFileInfo)currElement).getCategoryName();    %>              
        </logic:iterate>
</table>        


The way that I am attempting it from above is not working, the notEqual tag
is not seeing that the strings are equal.  I would like to be able to get
all the scriplets out of the jsp if possible.

Any suggestions would be appreciated.
________________________
Marty B. Jones
Senior Software Engineer
DailyAccess.Com


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

Reply via email to