velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Akehurst <akehu...@gmail.com>
Subject Constant values as Velocimacro parameters
Date Tue, 12 Oct 2004 16:33:01 GMT
I have the following Velocimacro defined:

#macro( optionValue $currentValue $defaultValue )
        #set( $currentValue = $currentValue.toString() )
        #set( $defaultValue = $defaultValue.toString() )

        #if ( $defaultValue.equals( $currentValue ) )
                selected
		#end
        value="$defaultValue"
#end

And I am calling this macro like so:
#set $foo="-1"
<option #optionValue($foo "50") >Bar Baz</option>

When the page is rendered, velocity.log has this error message:

Tue Oct 12 15:25:00 GMT 2004  [error] VMProxyArg.setObject() :
Programmer error : I am a constant!  No setting! : defaultValue / '50'

Is the syntax I am using above illegal or could it be done a different
way as to avoid the error in the log above?

-Justin Akehurst

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