You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Tarun <ta...@secf.com> on 2005/06/23 07:06:16 UTC
How two iterate two context in a single foreach loop
hii
I am using velocity view template with turbine framework.
i am getting two context on the velocity template say
context1 and context2. Both these contexts have an array of string and of
same length.
Now in a single loop i want to iterate the values of both the context. But i
am not able to do that.
what i was trying to do is that:-
#set($counter = 0)
#foreach($ctx1 in $context1)
<select name="combobox">
<option value="$context2[$counter]">$ctx1</option>
</select>
#end
Here in the foreach loop $ctx1 is returning me the exact values but the
$context2[$counter] is returning me the object of the array string.
so i am not able to get the values. So is there any way in which i can
iterate the two context in a single foreach loop or any another way you can
suggest.
Thanks in Advance
Tarun