velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Williams <adamsgeem...@gmail.com>
Subject Map creation outside of #set
Date Mon, 11 Apr 2005 17:32:05 GMT
Hello,

I am buiding something similar in spirit to Rails
(http://www.rubyonrails.org), http://www.javaonsails.org.
Unfortunately, Java is not so elegant when it comes to writing the
HTML templates. Enter Velocity.

I really need the ability to define a Map outside of a #set. For instance:

    $form.select('model.property', { 'onChange' : 'doSomethingCool()',
'style' : 'color: red' })

Right now, with what is in cvs (when is 1.5 going to be released,
btw?), as far as I can tell, I have to do this:

    #set($attrs = { 'onChange' : 'doSomethingCool()', 'style' : 'color: red' })
    $form.select('model.property', $attrs)

Ugh.

Please tell me I am wrong. I looked at the Velocity source, and I am
99.9% certain that I am not. How hard would it be to get this? Maybe
the real question should be, why doesn't Velocity have this already?

  adam williams

---------------------------------------------------------------------
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