velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravikanth.L" <ravikanth_lo...@yahoo.com>
Subject constructing variable names dynamically
Date Wed, 25 Aug 2004 10:01:06 GMT
Hi

 I am new to this velocity framework. I have a
scenario where in i should be able to dynamically
create a variable name used in template.

Eg:

 I have a arraylist of elements in $elements

 #foreach( $item in $elements )
   //need to create a variable with the value given by
getElementName() and assign the value
   #set($elementName = $item.getElementName())
   #set($$elementName = $item.getValue())

i.e if my elmementName is "Name" i would like to
create a variable name as $Name and assign the value
to this variable and use in the template.

Any suggestions are welcome

With Regards,
Ravikanth.L



		
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

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


Mime
View raw message