velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claude Brisson" <cla...@savoirweb.com>
Subject Re: VTL identifier in getBean()
Date Fri, 11 Jul 2003 13:02:30 GMT
$$ is not (yet ?) supported.

When the first object has a generic getter, a common workaround is :

$!form.bean.get("$fieldname")

CloD

----- Original Message ----- 
From: "Melcy Mahesh" <melcymahesh@yahoo.com>
To: "Velocity" <velocity-user@jakarta.apache.org>
Sent: vendredi 11 juillet 2003 14:55
Subject: VTL identifier in getBean()


> Hi All,
>  
> I am using the velocity-struts tool for my web application.
>  
> While using the formTool, I see that,
>  
> #set ($defaults = $form.bean) 
> <input type="text" name="username" value="$defaults.username">
> 
> is valid.
>  
> Can I use a VTL as below?
>  
> $set ($fieldname = "username")
> <input type="text" name="$fieldname" value="$!form.bean.$fieldname">
>  
> I did try the Formal notation, with 
> <input type="text" name="$fieldname" value="$!form.bean.{$fieldname}">
>  
> but doesn't work.
> I do find the problem for the "value" alone. Looks like it doesn't get parsed fine.
> I need this to have a dynamic name for my text box.
>  
> Is the above a valid reference or have I missed something or overlooked something?
>  
> Thanks,
> Melcy
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!


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