cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agssa.net>
Subject [JXTemplate] Sum values inside <jx:forEach>
Date Wed, 04 Feb 2004 08:37:47 GMT
Hi:

I am trying to get the sum of some values inside 2 <jxForEach>. Here is
the code:

<jx:set var="total" value="${0}"/>
<jx:set var="costo" value="${0}"/>
<jx:forEach var="activity" items="${bean.planActivityList}">
  <jx:forEach var="item" items="${activity.planCostList}">
    <jx:set var="total" value="#{item.pco_total + $total}"/>
    <jx:set var="cost" value="#{item.pco_cost + $cost}"/>
  </jx:forEach>
</jx:forEach>
<td><jx:formatNumber value="#{$total}"/></td>
<td><jx:formatNumber value="#{$cost}"/></td>
<td><jx:formatNumber value="#{$total - $cost}"/></td>

The problem is that this always return 0 values.

What I am doing wrong?

Best Regards,

Antonio Gallardo

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


Mime
View raw message