You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Mohammed Shafi <sh...@gmail.com> on 2008/03/17 14:36:08 UTC

Want to display range of values in a drop down list using velocity template

Hi All,

I want to display a range of values in a drop down list using velocity
template.

I hav written the following code ...
 #foreach($p in $productMap)  // productMap is a Map containg all vaues 
<td class="qty">
		#set ($minQty = 1)
		
		#set ($qtyCount = ${p.inventory.NetTotal}) 
			
		#set ($counter = [$minQty..${qtyCount }])
		
        <select id="cartItems[$cartItemIndex].quantity"
name="cartItems[$cartItemIndex].quantity">
	      #foreach( $index in $counter )
		 <option #if($cartItem.quantity == $index)selected #end                                
value="${index}">${index}</option>
          #end
        </select>
	
        #springShowErrors("<br>" "req")
       #else
        $cartItem.quantity
	   #end
	</td>
#end


The result of this code is that its not showing range of values in the drop
down list ... its coming empty....

Please let me know if anybody knows abt the answer.......
-- 
View this message in context: http://www.nabble.com/Want-to-display-range-of-values-in-a-drop-down-list-using-velocity-template-tp16092682p16092682.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