#574 closed defect (fixed)
dojo.io.checkChildrenForFile evaluates length.getAttribute - is not a function
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Core | Version: | 0.3 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
Using dojo.io.bind with a formNode, I get an exception in dojo.io.checkChildrenForFile (BrowserIO.js line 15 / trunk HEAD) :
"input.getAttribute is not a function"
this is because the result of the call on line 12 of BrowserIO.js:
var inputs = node.getElementsByTagName("input");
'inputs' does not evaluate to an Array according the dojo.lang.isArray, which is called in dojo.lang.forEach
this eventually causes inputs.length.getAttribute() to be attempted
in Venkman, 'inputs' is an HTMLCollection object (FF1.5 WinXP)
based on the svn log for lang/common.js, dojo.lang.forEach was modified a couple of times each by 2 different developers on 03-24. This may be part of it. I do not know if this was a problem prior to now, because I just created this case.
Also, the form is created via ContentPane?.setContent, which uses innerHTML. I'm mentioning this because I'm imagining that the node-tree created via setting innerHTML may have peculiarities about it that cause the error in my case but not in the normal case (where the content is not set with innerHTML).
Thanks.
Attachments (1)
Change History (9)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Component: | General → Core |
---|---|
Version: | 0.2 → 0.3 |
comment:3 Changed 16 years ago by
Cc: | [email protected]… added |
---|---|
severity: | normal → blocker |
I hit this same bug when trying to migrate from 0.2.2 to trunk in order to gain other features.
Blocks use of "formNode" in dojo.io.bind().
It seems to work for me when I change dojo.lang.forEach to test for isArrayLike
in place of isArray
, as suggested above.
Changed 16 years ago by
Attachment: | ticket_574_isArrayLike.patch added |
---|
as suggested in first comment
comment:4 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
This appears to be fixed after the latest changes to dojo.lang.forEach (just checked in later today). I just tried with test_IframeIO.html with the latest from SVN, and I did not get any errors.
comment:5 Changed 16 years ago by
does this still work? It looks like sjmiles rolled back his patch to forEach. We should retest.
comment:6 Changed 16 years ago by
Milestone: | → 0.3release |
---|
should dojo.lang.forEach be calling dojo.lang.isArrayLike instead of isArray?