cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist>
Subject Re: Jxtemplate forEach Variables
Date Wed, 04 Aug 2004 18:21:14 GMT

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" 
	<jx:if test="loop.last != 'true'">,</jx:if>

...or somethin' like that.  See


View raw message