You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Ivan <iv...@buc.com> on 2001/02/13 17:55:44 UTC
ArrayList Failure
Christoph's note of Jan 24 says that I can use an array defined in the
template, but I haven't been successful.
Velocity.jar version: nightly build 20010213
Template snipet:
#set ($condText = ["Mint", "Better Condition", "Average Condition",
"Fair", "Poor", "Restorable"])
---
I've tried
#if ($b.adjusted)Fair Market Price Adjusted for
$condText.get($query.cond): $b.adjusted<br>#end
and this
#set ($i = $query.cond)
#if ($b.adjusted)Fair Market Price Adjusted for $condText.get($i):
$b.adjusted<br>#end
and this
#set ($i = $query.cond)
#if ($b.adjusted)Fair Market Price Adjusted for $condText.get(i):
$b.adjusted<br>#end
None of the above work ...Log file says that $condText.get(i) or
$condText.get($i) or $condText.get($query.cond) is not a valid
reference.
The following works:
#if ($b.adjusted)Fair Market Price Adjusted for $condText.get(2):
$b.adjusted<br>#end
Am I missing something here?
Ivan Saltz
(P.S. This will be a production system.)