You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sean Powell <se...@legalmatch.com> on 2015/01/28 23:07:13 UTC

Dynamic Attributes with Velocity

I have a question about how to set dynamic Attributes of a Struts 2 tag in a Velocity template.

I've been trying to do it this way, but Struts is treating my Map as a String.

#stextfield("label=TFLable" "name=TFName" "value=TFValue" "id=TFId" "dynamicAttributes=#{'data-ajax':'false'}")

Thank you,

Sean Powell

RE: Dynamic Attributes with Velocity

Posted by Martin Gainty <mg...@hotmail.com>.
                                                                                                    


> From: sean.powell@legalmatch.com
> To: user@struts.apache.org
> Subject: Dynamic Attributes with Velocity
> Date: Wed, 28 Jan 2015 22:07:13 +0000
> 
> I have a question about how to set dynamic Attributes of a Struts 2 tag in a Velocity template.
> 
> I've been trying to do it this way, but Struts is treating my Map as a String.
> 
> #stextfield("label=TFLable" "name=TFName" "value=TFValue" "id=TFId" "dynamicAttributes=#{'data-ajax':'false'}")

MG>specify dynamicAttributes as {"K1":"V1", "K2":"V2"} e.g.
<#assign s=JspTaglibs["/WEB-INF/struts.tld"] /><@s.textfield name="TFName" dynamicAttributes={"data-ajax":"false","key":"value"}/>http://struts.apache.org/docs/freemarker-support.html

> 
> Thank you,
> 
> Sean Powell
 		 	   		  

Re: Dynamic Attributes with Velocity

Posted by Lukasz Lenart <lu...@apache.org>.
2015-01-28 23:07 GMT+01:00 Sean Powell <se...@legalmatch.com>:
> I have a question about how to set dynamic Attributes of a Struts 2 tag in a Velocity template.
>
> I've been trying to do it this way, but Struts is treating my Map as a String.
>
> #stextfield("label=TFLable" "name=TFName" "value=TFValue" "id=TFId" "dynamicAttributes=#{'data-ajax':'false'}")

Have you tried with %{} ?


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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