Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4150

Support attributes with hyphens in tag dynamic attributes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.15.1
    • 2.3.20
    • Other
    • None

    Description

      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:

      <@s.form ... data-ajax="false">
      </@s.form>
      

      Unfortunately, this doesn't work because Freemarker doesn't allow hyphens in macro parameter names. I entered an enhancement request for this here: https://sourceforge.net/p/freemarker/bugs/395/

      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.

      <@s.form ... >
        <@s.param name="dyn:data-ajax" value="false"/>
      </@s.form>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            perfnorm Jasper Rosenberg
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: