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

freemaker Checkboxlist not rendering id correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.16.1
    • Fix Version/s: 2.3.20
    • Component/s: Core Actions
    • Labels:
      None
    • Environment:

      Tomcat/centos

      Description

      The existing code:

      <input type="checkbox" name="${parameters.name?html}" value="${itemKeyStr?html}"
             id="${parameters.name?html}-${itemCount}"<#rt/>
      

      needs to check for the id before adding the name ie:

      <input type="checkbox" name="${parameters.name?html}" value="${itemKeyStr?html}"<#rt/>
          <#if parameters.id??>
             id="${parameters.id?html}-${itemCount}"<#rt/>
          <#else>
             id="${parameters.name?html}-${itemCount}"<#rt/>
          </#if>
      

      Also the label needs the mods also:

      from:

      <label for="${parameters.name?html}-${itemCount}" class="checkboxLabel">${itemValue?html}</label>
      

      to:

      <label<#rt/> 
          <#if parameters.id??>
              for="${parameters.id?html}-${itemCount}"<#rt/>
          <#else>
              for="${parameters.name?html}-${itemCount}"<#rt/>
          </#if>
              class="checkboxLabel">${itemValue?html}</label>
      

        Attachments

        1. struts.patch
          1 kB
          Greg Huber

          Activity

            People

            • Assignee:
              ghuber Greg Huber
              Reporter:
              ghuber Greg Huber
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: