D'oh!  That's exactly what I was looking for.  I suppose someone
should have responded with RTFM :)  I did read the docs but for some
reason I missed that whole section there on varStatus.

Thanks for the help,

- Brent

On Wed, 4 Aug 2004 11:21:14 -0700, Mark Lundquist <[EMAIL PROTECTED]> wrote:
> 
> On Aug 4, 2004, at 8:21 AM, Brent Johnson wrote:
> 
> > When looping in a JXTemplate using jx:forEach I can refer to the
> > current item as the variable specified in the var attribute.  Are
> > there any other variables I can access in this loop related to the
> > loop itself?  I'd like to be able to test an expression to find out if
> > I'm at the last item in the loop.  Here's an example:
> >
> > ----
> > List of items:
> > <jx:forEach items="${location.getContainer()}" var="item">
> >     ${item.getName()},
> > </jx:forEach>
> > ----
> 
> Heya, Brent-Bob, dig on this...
> 
> <jx:forEach items="${location.getContainer()}" var="item" 
> varStatus="loop">
>      ${item.getName()}
>         <jx:if test="loop.last != 'true'">,</jx:if>
> </jx:forEach>
> 
> ....or somethin' like that.  See
> http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html#forEach
> 
> HTH,
> ~ml
> 
>

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

Reply via email to