Struts 2
  1. Struts 2
  2. WW-2393

s:submit doesn't work in IE7 when submitting a s:form that contains a textfield named "id"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: Future
    • Component/s: Plugin - Dojo Tags
    • Labels:
      None

      Description

      Using the s:submit tag in order to post data from a s:form that contanis a textfield named "id" doesn't in IE7.
      After doing some debug I found a problem in the javascript generated by dojo plugin (dojo.js), specifically in the dojo.byId function. There, it looks for a form with the given id. At first it works well, but then it checks if the id of the found element is the same of the given id. If the form contains a textfield with the name "id", the function returns wrond value.

      Here's the dojo source with some comments...

      dojo.byId=function(id,doc){

      if((id)&&((typeof id=="string")||(id instanceof String))){
      if(!doc)

      { doc=dj_currentDocument; }

      var ele=doc.getElementById(id);

      //*************
      // If you have a for with a textfield with the name "id" the
      // test (ele.id!=id) always returns false....
      //*************
      if(ele&&(ele.id!=id)&&doc.all){
      ele=null;
      eles=doc.all[id];

      if(eles){
      //****************************
      // Here's the problem ... "eles.length" is
      // not the number of forms with the same id, but rather,
      // the number of the inner elements of the form...
      // textfields, for example
      //****************************
      if(eles.length){
      for(var i=0;i<eles.length;i++){
      if(eles[i].id==id)

      { ele=eles[i]; break; }

      }

      }else

      { ele=eles; }


      } }
      return ele; }
      return id; };

      Some pieces of the source I coded:

      <s:form id="formId" theme="ajax" namespace="/ajax" method="post" ...>
      <s:textfield label="Id" name="id" cssClass="textfield"/>
      </s:form>

      the submit button (outer):
      <s:submit formId="formId" targets="list" theme="ajax" .../>

      the s:div
      <s:div id="list" ...></s:div>

        Activity

        Lukasz Lenart made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jeff Turner made changes -
        Project Import Mon Feb 01 01:17:42 UTC 2010 [ 1264987062082 ]
        musachy made changes -
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        musachy added a comment -

        Closing dojo related tickets as "Won't fix". if you have a patch for this issue, feel free to attach it and re-open.

        Show
        musachy added a comment - Closing dojo related tickets as "Won't fix". if you have a patch for this issue, feel free to attach it and re-open.
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status (temporary) [ 48700 ] Struts - editable closed status [ 52097 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status [ 44778 ] Struts - editable closed status (temporary) [ 48700 ]
        Ted Husted made changes -
        Field Original Value New Value
        Fix Version/s Future [ 21530 ]
        Hide
        Ted Husted added a comment -

        Setting to future pending a patch.

        Show
        Ted Husted added a comment - Setting to future pending a patch.
        Volceri D Avila created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Volceri D Avila
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development