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

freemaker Checkboxlist not rendering id correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.16.1
    • 2.3.20
    • Core Actions
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: