In my template $velocityCount varibale is not recognizing.Shall I include any package to recognise this variable...
Thanks Venkat Dama
From: [EMAIL PROTECTED]
Reply-To: "Velocity Developers List" <[EMAIL PROTECTED]>
To: Velocity Developers List <[EMAIL PROTECTED]>
Subject: Re: Velocity related problem --- displaying inly perticular item in a List
Date: Fri, 19 Sep 2003 10:15:10 +0200
RTFM... if the reference $billgrp in the template emits Billgrp1:[12,13,15,17] to the output, then your orbject is somewhat strange. a) billgrp is a special object, and probable has a custom toString() method velocity is then using. b) OTOH, as the name is implying... each $billgrp is probably a group itself? So you might need an inner loop or use specific accessor methods to get parts of it.
You can try to find out more about your object by debugging it placing $billgrp.class.name in the template.
Then look at the ApiDoc or the interface description for that class.
Also note that velocity allows ranges in the foreach: #foreach ($billgrp in $additionalorder.getBillGroupIdDisplay()) #foreach( $i in [0..1] ) #set( $index1 = ${velocityCount} + 1 ) Billgrp${index1}: $billgrp.getXYZ($i) #end #end
Hope this helps you to deeper understanding, Christoph
venkat dama wrote:
Hi All,
I have a problem in velocity any help on this greatly appreciated.
\begin {tabular} {ll} #foreach ($billgrp in $additionalorder.getBillGroupIdDisplay()) $billgrp #end \end {tabular}
in the above code $additionalorder.getBillGroupIdDisplay is a List and $billgrp displays a list of values like [12,13,15,17] but I want to display only first two values in the list and not all.
My expected output is : Billgrp1:12 Billgrp2:13
my current result is Billgrp1:[12,13,15,17]
I aslo tried with $billgrp.get(0) to get first element and this is not working in Velocity.
Thanks & Regards Venkat
-- :) Christoph Reck
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Compare Cable, DSL or Satellite plans: As low as $29.95. https://broadband.msn.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]