Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16475 closed defect (fixed)

TabContainer: exception on destroyRecursive(true)

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.9
Component: Dijit Version: 1.8.1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

See mailing list thread.

To reproduce this issue, navigate to dijit/tests/layout/test_TabContainer.html, and in the browser console, enter:

dijit.byId("mainTabContainer") .destroyRecursive(true)

The browser console returns:

"TypeError: Cannot read property 'id' of undefined"

StackController’s destroy looks like this:

destroy: function(){
    for(var pane in this.pane2button){
        this.onRemoveChild(dijit.byId(pane));
    }
    this.inherited(arguments);
}

The issue is that the pane has already been deleted, so dijit.byId(pane) fails.

Note that destroyDescendants() without an argument works fine because by the time that code is reached, the pane2Button[] hash is empty. Which leads to the real underlying issue, that StackContainer.destroyDescendants(true) doesn't call removeChild() on each child, even though it seems like it should.

Change History (4)

comment:1 Changed 7 years ago by bill

Milestone: tbd1.9
Status: newassigned
Summary: TabContainer: exception ondestroyRecursive(true)TabContainer: exception on destroyRecursive(true)

Marking this as 1.9 for now. The preserveDom flag was never claimed to work on templated widgets such as TabContainer, but still, this report exposes some cleanup that can be done on the code, so I'll do that.

comment:2 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [30190]:

Simplify logic to destroy tablist, avoiding problem on TabContainer.destroyRecursive(true) where we try to reference a pane that was already destroyed. Note though that the preserveDom flag is explicitly documented as being unsupported for templated widgets like TabContainer. Fixes #16475 !strict.

comment:3 Changed 7 years ago by bill

In [30192]:

Get rid of StackController's map from page id to button. It's not really needed, and seems like getting rid of it brings us one step closer to server side instantiation. Refs #16475 tangentially !strict.

comment:4 Changed 7 years ago by bill

Description: modified (diff)
Note: See TracTickets for help on using tickets.