You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcello Savino <Ma...@aldebra.com> on 2006/12/13 10:18:34 UTC
logic:iterate, tfoot and sum
Hi, i've a questione regarding sum calculation in a table:
The jsp look like this one:
<logic:present name="lista">
<div class="lista"><c:set var="recCount" value="${0}" />
<table class="scrollable" id="lista"
<thead>
<tr>
<th id="hNr" colspan="2">Nr</th>
</tr>
</thead>
<tfoot>
<tr>
<td><c:out
value="${recCount}"></c:out></td>
</tr>
</tfoot>
<tbody>
<logic:iterate id="index" name="lista">
<c:set var="recCount"
value="${recCount+1}" />
<tr>
<td headers="hNr"
class="Numeric"><bean:write
name="index"
property="number" /></td>
</tr>
</logic:iterate>
</tbody>
</table>
</div>
</logic:present>
</html:form>
Obviously the recCount outputted is 0. To output the right value i have
to put the tfoot after the tbody section but this is not allowed by the
DTD. I would not pre-calculate the rowCount due performance problem.
Does anybody have some ideas to solve this problem ?
Thanks in advance
Ciao, Marcello
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org