Opened 10 years ago

Closed 10 years ago

#8331 closed defect (wontfix)

error when destroying a ContentPane widget

Reported by: m104 Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

I get the error shown below when calling destroyRecursive on a ContentPane? widget. I have a simple test case, which is a bit big because I put the dojo and dijit trees in it. The version of Dojo is 1.2.3, build 15997.

Just expand the tar file and open file destroyrecursive.html, the close the "Select country" tab to see the error.

Error message:

node has no properties
toString(null, "dijitTabContainerTop-dijitContentPane")dojo.js (line 16)
(no name)([Widget dijit.layout.ContentPane, dijit_layout_ContentPane_0] _connects=[0] _deferredConnects=Object)dojo.js (line 78)
toString("removeChild", [[Widget dijit.layout.ContentPane, dijit_layout_ContentPane_0] _connects=[0] _deferredConnects=Object], undefined)dojo.js (line 16)
(no name)([Widget dijit.layout.ContentPane, dijit_layout_ContentPane_0] _connects=[0] _deferredConnects=Object)dojo.js (line 73)
(no name)([Widget dijit.layout.ContentPane, dijit_layout_ContentPane_0] _connects=[0] _deferredConnects=Object)dojo.js (line 141)
(no name)([Widget dijit.layout.ContentPane, dijit_layout_ContentPane_0] _connects=[0] _deferredConnects=Object)dojo.js (line 226)
toString()dojo.js (line 16)
toString()dojo.js (line 16)
toString()dojo.js (line 16)
[Break on this error] (function(){var _1=null;if((_1||(typeof djConfig!="undefined"&&djConfig.scopeMap...

Attachments (1)

destroyrecursive.tar.bz2 (37.5 KB) - added by m104 10 years ago.
I had to remove the dojo and dijit trees to meet the file size limit. The directories are still the tar file but they're symbolic links.

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by m104

Attachment: destroyrecursive.tar.bz2 added

I had to remove the dojo and dijit trees to meet the file size limit. The directories are still the tar file but they're symbolic links.

comment:1 Changed 10 years ago by Adam Peller

Component: GeneralDijit
Owner: anonymous deleted

comment:2 Changed 10 years ago by bill

Resolution: wontfix
Status: newclosed

Yah, this is essentially a user error. You do:

     this._contentPane = new dijit.layout.ContentPane({
        title: "Select country", ...
            onClose: dojo.hitch(this, this._closePane)
            });

where _closepane() is defined as:

    _closePane: function() {
      var container = dijit.byId('tabcontainer');
      container.removeChild(this._contentPane);
      this._contentPane.destroyRecursive();
      return true;
    }

_closePane() is confusing TabContainer because it destroys the ContentPane before TabContainer has had a chance to do the removeChild() code. And when TabContainer (or any layout containers) removes a child (where "remove" means 'detach' rather than 'destroy'), it removes some CSS classes from the child's DOM node.

So, I think you will need to connect to removeChild() on the TabContainer, and do your processing after the child has been removed.

Note: See TracTickets for help on using tickets.