Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12191 closed defect (fixed)

[regression] BorderContainer: splitters not destroyed

Reported by: jturo Owned by: bill
Priority: high Milestone: 1.6
Component: Dijit Version: 1.6.0b1
Keywords: TabContainer, keywords Cc:
Blocked By: Blocking:

Description (last modified by bill)

I'm dynamically loading pages into a dijit.layout.TabContainer but it seems the tab container is unregistering all the widgets but "splitters" when the tab gets destroyed. I tried comparing the registered widgets for every step and i got this result:

/////////////////// INITIAL WIDGETS ID LIST
dijit_layout_BorderContainer_0
dijit_layout_ContentPane_0
.
.
dijit__TreeNode_22
dijit__TreeNode_23
dijit__TreeNode_24
dijit__TreeNode_25
dijit__TreeNode_26

/////////////////// AFTER LOADING A TAB

dijit_layout_BorderContainer_0
dijit_layout_ContentPane_0
.
.
dijit__TreeNode_22
dijit__TreeNode_23
dijit__TreeNode_24
dijit__TreeNode_25
dijit__TreeNode_26

      // WIDGET IDS WITHING THE TAB
      tab-adminuser
      mainTabs_tablist_tab-adminuser
      mainTabs_tablist_tab-adminuser_Menu
      dijit_MenuItem_0
      dijit_layout_BorderContainer_1
      dijit_layout_BorderContainer_2
      dijit_layout_ContentPane_2
      adminuser-search
      ___viewpane
      dijit_layout_BorderContainer_2_splitter
      ___viewpane_splitter


/////////////////// AFTER REMOVING THE LOADED TAB


Widgets registered
dijit_layout_BorderContainer_0
dijit_layout_ContentPane_0
.
.
dijit__TreeNode_22
dijit__TreeNode_23
dijit__TreeNode_24
dijit__TreeNode_25
dijit__TreeNode_26

      // UNREGISTERED WIDGET IDS
      dijit_layout_BorderContainer_2_splitter
      ___viewpane_splitter

i'm uploading 2 files that reproduce the problem

thanks

Attachments (1)

2_html_files.zip (2.4 KB) - added by jturo 9 years ago.
Reproduction of the problem (2 html files)

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by jturo

Attachment: 2_html_files.zip added

Reproduction of the problem (2 html files)

comment:1 Changed 9 years ago by Adam Peller

Component: DojoX LayoutDijit

comment:2 Changed 9 years ago by bill

Description: modified (diff)
Milestone: tbd1.6
Owner: set to bill

I'll take a look

comment:3 Changed 9 years ago by bill

OK, what's the procedure to reproduce the problem? Am I supposed to uncomment that code in tab1.html?

I load the page as is and it seems to be working. There's a "Load Tab 1" button but it's disabled.

comment:4 Changed 9 years ago by jturo

  • To clarify:

The reason why wrote 2 examples (the commented and the uncommented) is to demonstrate that the problem is not happening for every dojo element that's defined within a tab, it only seems to be happening with content pane splitters.

  • How to reproduce the error:

In oder to reproduce the error using the current chunk of code (uncommented) you can: 1) Close the tab "Testing" (at this point the tab is supposed to be destroy along with its descendants). At this point, none of the widgets within the tab1.html are supposed to be registered. 2) Click the button "Load Tab 1" to reload the tab. Check the console and you will see the error message "Error: Tried to register widget with id==_viewpane_splitter but that id is already registered". "_viewpane_splitter" was supposed to get destroyed along with the other widgets the moment i closed the tab.

If you uncomment the first chunk of code and comment out the second one you'll see that no error will occur.

IMPORTANT NOTE: I just realized that in my example file "index.html" i was trying to destroy the descendants manually so please comment out the line "35: this.destroyRecursive();" (in the index.html) and you will see the problem that im stuck in.

comment:5 Changed 9 years ago by bill

Ah I see it. You also need to select tab "Testing" before deleting it, and after recreating it, to get the URL to load. Thanks for the report.

comment:6 Changed 9 years ago by bill

Summary: Problem destroying splitters in a tab container[regression] BorderContainer: splitters not destroyed

comment:7 Changed 9 years ago by bill

Resolution: fixed
Status: newclosed

(In [23650]) Fix destroy of splitters on BorderContainer destroy, and add tests for proper cleanup on destroyRecursive() and removeChild().

Also moved non-robot tests to regular DOH BorderContainer.html test file, and replaced button clicks with direct function calls.

Refs #11030 ([23442]), fixes #12191 !strict.

comment:8 Changed 9 years ago by jturo

That's incredible. Thanks Bill.

Note: See TracTickets for help on using tickets.