velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shinobu.ka...@gmail.com>
Subject Re: Clearing content for dynamically constructed variables - Urgent
Date Fri, 17 Sep 2004 14:29:05 GMT
Hi Ravikanth,

> i construced the variable with the following syntax
> 
> $render.recurse($ctx, '\#set($$name = "$theValue")' )


> Now the problem is...
> 
> I have this construction of variable in a macro which
> i will be using recursively for processing the
> hierarchy. For the top most level, it is able to
> create the dynamic variables and assign the value. But
> for all sub level hierarchy items, value of $id is not
> getting replaced with proper value. It is still taking
> the value of the top level $id. I checked that the
> $theValue is not returning null or empty String ("")
> for child elements.  I am struck at this point. If
> anyone knows the solution for this, kindly let me
> know.
That is strange.  Can you provide minimal code that shows what is not
working?  In my environment,
    #set($name = "id")
    #set($theValue = "Hello")
    $render.recurse($ctx, '\#set($$name = "$theValue")')
    $id
    #set($theValue = "World")
    $render.recurse($ctx, '\#set($$name = "$theValue")')
    $id
works perfectly fine, and says Hello World.

Best regards,
-- Shinobu Kawai

-- 
Shinobu Kawai(shinobu.kawai@gmail.com)

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