velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nadesan, Binu" <bnade...@cincom.com>
Subject RE: Problems with ViewRenderTool
Date Mon, 13 Dec 2004 18:33:30 GMT
Thanks...

recurse=$render.recurse("$$e.$text") this has solved my problem

Regards...
Binu Nadesan.
(513) 612-2206.


-----Original Message-----
From: Claude Brisson [mailto:claude@renegat.net] 
Sent: Monday, December 13, 2004 11:44 AM
To: Velocity Users List
Subject: RE: Problems with ViewRenderTool

sorry, I answered too fast...

After having checked, here is what does work for me :


recurse=$render.recurse("$$e.$text")

Claude


On Mon, 2004-12-13 at 17:36, Claude Brisson wrote:
> none of your attempts was correct.
> try :
> 
> $render.recurse("${D}${e}.${D}$text")
> 
> Claude
> 
> On Mon, 2004-12-13 at 17:20, Nadesan, Binu wrote:
> > Hi All,
> > 
> > I tried using all these techniques with the render tool and nothing
seems to
> > work for me.
> > 
> > 1. $render.eval( "${e}.${text}" )
> > 
> > 2. #set($D = "$")
> > #set($getText = "${D}e.$text")
> > $render.eval($getText)
> > 
> > 3. #set($D = "$")
> > $render.recurse("${D}e.$text")
> > 
> > Let's say that "foo" was the value of $text. And $e is the object
> > In all the above cases, the final output is the string values of the
object
> > and the property "foo."
> > 
> > Something like 
> > 
> > "Billing.foo"
> > "Shipping.foo"
> > 
> > If I type-in directly say $e.foo then I get the proper value. Like 
> > "Billing"
> > "Shipping"
> > 
> > 
> > 
> > Regards...
> > Binu Nadesan.
> > (513) 612-2206.
> > 
> > 
> > -----Original Message-----
> > From: Simon Christian [mailto:sjc@xtian.org.uk] 
> > Sent: Friday, December 10, 2004 4:46 PM
> > To: Velocity Users List
> > Subject: Re: Problems with ViewRenderTool
> > 
> > Hi Binu,
> > 
> > I think the problem is that the parsers is trying to evaluate "$e.$text"

> > all in one go. The documentation suggests encapsulating the varriables 
> > i.e. $render.eval( "${e}.${text}" )
> > 
> > http://jakarta.apache.org/velocity/tools/view/ViewRenderTool.html#eval()
> > 
> > Never actually used this particular 'tool myself, but I think that 
> > should solve the problem.
> > 
> > - simon
> > 
> > Nadesan, Binu wrote:
> > > Hi All,
> > > 
> > > I have problem with the Velocity ViewRender tool. Please see the macro
> > > below...
> > > 
> > > The problem lies with the statement $render.eval("$e.$text")
> > > 
> > > Here $e is an object and $text contains a string value that is a
property
> > of
> > > the object.
> > > 
> > > Some how the tool is  not able to return the value of the object
property.
> > I
> > > am I missing something here....
> > > 
> > > 
> > > #macro (selectcontrol $name $selected $list $id $text)
> > > 	#set($s="NULL" )
> > > 	#set($s=$selected )
> > > 	<select name="$name">
> > > 	#foreach ($e in $list )
> > > 	#set($v = $render.eval("$e.$id"))
> > > 	<option value="$v"#if("$v"=="$s")
> > > selected="selected"#end>$render.eval("$e.$text")</option>
> > > 	#end
> > > 	</select>
> > > #end
> > > 
> > > Regards...
> > > Binu Nadesan.
> > > (513) 612-2206.
> > > 
> > > 
> > > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message