struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcello Savino" <Marcello.Sav...@aldebra.com>
Subject logic:iterate, tfoot and sum
Date Wed, 13 Dec 2006 09:18:34 GMT
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


Mime
View raw message