Barracuda: 2 Iterations with 1 model

"Thuong Nguyen" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <19B60770BB7B984FA76B9D653AF2371E015016@platmail01.corp.theplatform.com>
Hi,

I wonder if someone has done something similar to what I'm trying to do
below (or have any ideas on how to do it).

In the HTML below, I'm trying to render a table that includes a row for
every items (books) and, for each category of items, a "sub-total" row.
The very last row contains the grand total.  I can have a model
implementing IterativeModel to iterate over each item.  However, I
couldn't figure out how to render (handle) the "sub-total" row.  There
could n number of items per category .. So I can't just have a
pre-determined number for <tr>'s.

One option I can think of is to have 2 iterations, but still using only
one model.  I'm not sure that would work ... But that's the idea of what
I'm trying to do.  However, I would like to see if I can take advantages
of directives like Veto_If_Null (or other custom directives) ... And to
hide or display the correct rows.

Hope you know what I'm talking about (or want).  If not, I can explain
further.

Thanks in advance!
-tn


<table>
<tr>
	<td>Category</td><td>Title</td><td>Quantity</td><td>Price</td>
</tr>
<tr>
	<td>Sports</td><td>MLB: The
History</td><td>1</td><td>$10.00</td>
</tr>		
<tr>
	<td>Sports</td><td>The 2003 Seattle
Mariners</td><td>2</td><td>$29.00</td>
</tr>
<!-- sub total row -->
<tr>
	<td colspan=2>Sports total</td><td>3</td><td>$39.00</td>
</tr>
<tr>
	<td>History</td><td>Planet Hong
Kong</td><td>1</td><td>$31.00</td>
</tr>
<!-- sub total row -->
<tr>
	<td colspan=2>History total</td><td>1</td><td>$31.00</td>
</tr>	
<!-- grand total row -->
<tr>
	<td colspan=2>Grand total</td><td>4</td><td>$70.00</td>
</tr>
</table>

_______________________________________________
Barracuda mailing list
[email protected]
http://www.enhydra.org/mailman/listinfo.cgi/barracuda
FAQ - http://www.jguru.com/faq/Barracuda
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.