tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul P Akolkar <akol...@us.ibm.com>
Subject Re: counter in forEach tag?
Date Thu, 26 May 2005 17:18:36 GMT
varStatus is good here too, it can give you the "count" of the current 
iteration. With that, for example, you can do a modulo 2 operation for 
alternating bgcolors or style classes.

-Rahul


"Scott Purcell" <spurcell@vertisinc.com> wrote on 05/26/2005 12:58:20 PM:

> Hello,
> I have this scenario come up occasionally, and have to opt to JSP 
> expressions on the page for a work-around.
> 
>  <c:choose>
>                   <c:when test="${assetCollection == null}">
>                      nothing
>                   </c:when>
>                   <c:otherwise>
>                     <c:forEach var="asset" items="${assetCollection}">
> 
> 
> BODY
> 
> 
>                       <c:out value="${asset.assetId}" />
>                     </c:forEach>
>                   </c:otherwise>
>                 </c:choose>
> 
> 
> In the forEach section, I am going to create a rows in a table which
> will be different colors for each row. How can I put in a counter 
> that I can then change the row color for? Basically, I would like to
> know what asset I am on in the body.
> 
> Thanks,
> Scott
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message