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

Support attributes with hyphens in tag dynamic attributes

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.15.1
    • Fix Version/s: 2.3.20
    • Component/s: Other
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: