Opened 15 years ago
Closed 15 years ago
#5118 closed defect (fixed)
Dialog: hide() followed quickly by destroy() throws error
Reported by: | guest | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Dijit | Version: | 1.0 |
Keywords: | dijit, dijit.Dialog, Dialog, destroy, destroyRecursive, hide | Cc: | tk |
Blocked By: | Blocking: |
Description (last modified by )
Calling dijit.Dialog.hide(), and then immediately calling dijit.Dialog.destroy() or dijit.Dialog.destroyRecursive() on a Dialog will throw an error "this.domNode has no properties". Interestingly, it cannot be caught by wrapping the call in a try/catch.
This is rather annoying since .hide() only hides the dialog, which makes it hard to do "throwaway" dialogs -- something that you create, use once, and destroy.
Attachments (2)
Change History (9)
Changed 15 years ago by
Attachment: | test_Dialog_bug.html added |
---|
comment:1 Changed 15 years ago by
Tried the test, works for me with no errors. I tried on FF2/mac. What browser were you using? See http://dojotoolkit.org/~bill/svn/test_Dialog_bug.html
comment:2 follow-up: 3 Changed 15 years ago by
FF 2.0.0.9, WinXP. Also occurs on MSIE7.0, but, strangely, not every time.
comment:3 Changed 15 years ago by
I tried it through the link you supplied, and... no error. The same file on my local system does produce it. Bizarre, I'll look into it further.
comment:4 Changed 15 years ago by
I was watching this bug (I entered a similar one, #5141). It works for me with no errors on FF 2.0.0.8/Mac, but if I add "widg.hide();" before "widg.destroyRecursive();" it produces an error.
comment:5 Changed 15 years ago by
Cc: | tk added |
---|
This is a race condition, when calling dlg.hide() you have to allow time for the underLay widget to be destroyed.... I found that adding a 500ms timeout between hide and destroy() works....
comment:6 Changed 15 years ago by
Description: | modified (diff) |
---|---|
Summary: | dijit.Dialog.destroy() throws error → Dialog: hide() followed quickly by destroy() throws error |
ah thanks for finding that... updating bug title/description
Changed 15 years ago by
Attachment: | test_Dialog_bug-1.html added |
---|
add hide() to test case; otherwise problem doesn't reproduce
comment:7 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Page that demonstrates the defect.