DWR

Javascript error in engine.js when file input field has no parentNode

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Normal Normal
  • Resolution: Unresolved
  • Affects Version/s: 3.0.M1, 3.0.RC1, 3.0
  • Fix Version/s: 3.0.1
  • Component/s: Engine
  • Description:
    Hide
    When uploading a file, dwr clones the input field, attaches it to a form and submits to the server.
    The cloned field should replace the original one.
    This is done by

    value.parentNode.insertBefore(clone, value);
    value.parentNode.removeChild(value);

    in engine.js.

    The problem is, that I use Ext.ux.form.BrowseButton to create my input field. (http://extjs.com/forum/showthread.php?t=29032)
    This function detaches the input form and puts it somewhere in the dom.
    It happens that my field does not have a parentNode when it is posted.

    So i would suggest to check for a parentNode, just like:

    if(value.parentNode != null) {
        value.parentNode.insertBefore(clone, value);
        value.parentNode.removeChild(value);
    }

    and everything works also if the element had no parent.
    Show
    When uploading a file, dwr clones the input field, attaches it to a form and submits to the server. The cloned field should replace the original one. This is done by value.parentNode.insertBefore(clone, value); value.parentNode.removeChild(value); in engine.js. The problem is, that I use Ext.ux.form.BrowseButton to create my input field. (http://extjs.com/forum/showthread.php?t=29032) This function detaches the input form and puts it somewhere in the dom. It happens that my field does not have a parentNode when it is posted. So i would suggest to check for a parentNode, just like: if(value.parentNode != null) {     value.parentNode.insertBefore(clone, value);     value.parentNode.removeChild(value); } and everything works also if the element had no parent.

Activity

There are no comments yet on this issue.

People

Dates

  • Created:
    12/Mar/09 4:22 PM
    Updated:
    23/Dec/10 9:47 PM