velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From newbie-gero <chongm...@e7tech.com>
Subject How to loop a for loop in velocity with counters
Date Tue, 03 Jun 2008 08:14:31 GMT

Greetings, i like to loop 2 for loops to display out the data.

For example in methodList, it contains 
element 0 : register mail 
element 1 : Normal mail

In paymentList, it contains
element 0: $5
element 1: $2


Currently this is what i have code in velocity:

#foreach( $code in $methodList)  $code.method :#foreach( $charge in
$paymentList) $charge.delivery_charge #end #end 

The results display are
REGISTER_MAIL : S$5.00  S$1.00    NORMAL_MAIL : S$5.00 
S$1.00  

Actually i want it to display as
REGISTER_MAIL : S$5.00
NORMAL_MAIL : S$1.00 

How do i do it in velocity?

Thanks in advance


-- 
View this message in context: http://www.nabble.com/How-to-loop-a-for-loop-in-velocity-with-counters-tp17618412p17618412.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message