Tapestry 5
  1. Tapestry 5
  2. TAP5-1207

A form control component (such as TextField) whose id is "id" can confuse client-side logic for the Form DOM object

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.0
    • Fix Version/s: 5.2.0
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Using Chrome's page inspector, I can see that the form's element has been rewritten, from:

      <form class="margin3-5-5" onsubmit="javascript:return Tapestry.waitForPage(event);" action="/t5/widendev/searchadmin.removedoc.form" method="post" id="form_3"

      to:

      <form class="margin3-5-5" onsubmit="javascript:return Tapestry.waitForPage(event);" action="/t5/widendev/searchadmin.removedoc.form" method="post" id="[object HTMLInputElement]"><div class="" style="display: none; ">

      ....

      ah, there is is:

      <label for="id">ID</label>
      <input class="normalField width60" size="5" id="id" name="id" type="text"></input><img id="id_icon" class="t-error-icon t-invisible" alt="" src="/assets/5.5.1_1/core/spacer.gif"/>

      Having a form element with id "id" is bad!

      Basically, each element of the form is mapped onto the Form as a property; so HTMLInputElement#id overwrites the id property of the Form (changing it from type string to type HTMLINputElement).

      "id" and perhaps other names need to be added to the list of pre-reserved element ids inside the Form.

        Activity

        Hide
        Hudson added a comment -

        Integrated in tapestry-5.2-freestyle #153 (See http://hudson.zones.apache.org/hudson/job/tapestry-5.2-freestyle/153/)

        Show
        Hudson added a comment - Integrated in tapestry-5.2-freestyle #153 (See http://hudson.zones.apache.org/hudson/job/tapestry-5.2-freestyle/153/ )
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Howard M. Lewis Ship [ hlship ]
        Fix Version/s 5.2.0 [ 12314122 ]
        Resolution Fixed [ 1 ]
        Howard M. Lewis Ship created issue -

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development