struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jasper Rosenberg (JIRA)" <>
Subject [jira] [Commented] (WW-4150) Support attributes with hyphens in tag dynamic attributes
Date Tue, 30 Jul 2013 19:17:50 GMT


Jasper Rosenberg commented on WW-4150:

FYI, you need to leave off the quotes to have it work:

<@s.form dynamicAttributes={'data-ajax':'false'}>

(You can also leave the single quotes from false if you want)
> Support attributes with hyphens in tag dynamic attributes
> ---------------------------------------------------------
>                 Key: WW-4150
>                 URL:
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions:
>            Reporter: Jasper Rosenberg
>            Priority: Minor
>             Fix For: 2.3.17
> A lot of CSS/JS frameworks look for attributes on html elements that include a hyphen
to do their magic (JQuery Mobile, Bootstrap, etc).
> For example, in my JQuery Mobile app, I'd like to be able to say:
> {code}
> <@s.form ... data-ajax="false">
> </@s.form>
> {code}
> Unfortunately, this doesn't work because Freemarker doesn't allow hyphens in macro parameter
names.  I entered an enhancement request for this here:
> I'm not sure when or if that might be fixed, so perhaps a work around would be to allow
explicit dynamic attributes through some kind of parameter convention.
> {code}
> <@s.form ... >
>   <@s.param name="dyn:data-ajax" value="false"/>
> </@s.form>
> {code}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message