cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michel Erard" <cocoon.er...@besonet.ch>
Subject counter in jx:foreach
Date Mon, 08 Oct 2007 12:41:19 GMT
Hello, 

I'm implemented this loop with jx:

<page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
              <jx:set var="counter" value="#{-1}"/> 
              <jx:forEach var="item" items="${list}">
                <jx:set var="counter" value="#{1 + $counter}"/>
                ${item} : ${counter}<br/>
              </jx:forEach>
</page>

function home() {
	var list = new ArrayList();
	list.add("test 1");
	list.add("test 2");
	list.add("test 3");
	list.add("test 4");
	list.add("test 5");
    cocoon.sendPage("home.page", {list:list});
}

the output is: 

test 1 : 0.0
test 2 : 0.0
test 3 : 0.0
test 4 : 0.0
test 5 : 0.0

the increment of the counter is only performed once. In older versions of cocoon this did
work, now with version 2.2 I've this problem.

Doe's somesing change? Is there another way to do this?

Tanks for any hints.

Mike 


____________________________________________
QuickLine WebMail - http://www.QuickLine.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message