Christopher,

I think it is a question for the dev's list, since it involves creating a new feature - a new directive - (or asking about velocity internals).Is not a question about how to use velocity. My bad if I'm mistaken.

The possibilities are limited by default, around 12(the standard Swing components), but the infrastructure is flexible so any time a new component type can be pluged in(the component factory registers a new #macro for every component type).

I would like to avoid those calling #if 12 times and anyway, it breaks the plug&play model.

Thanks.

Christopher Schultz wrote:
Adrian,

Adrian Tarau wrote:
I have the following problem : I would like to call a macro but the macro
name must be a variable.

This is more of a question for the user's list, not the dev list. In the future, please post there.

Ex: instead of #renderLabel($component) to have #call("renderLabel"
$component) - of course "renderLabel" can be any (existing) macro name.

How many possibilities can you have for $component? Are they unlimited, or constrained to maybe 5 possibilities? I'm wondering because you could easily do it like a switch:

#if('renderLabel' == $macroToCall)
#renderLabel($component)
#elseif('renderInput' == $macroToCall)
#renderInput($component)
#elseif(...)
...
#end

-chris



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to