Opened 9 years ago

Closed 9 years ago

#11413 closed defect (worksforme)

(Fixed Code Provided) AccordionContainer fails when removing selectedChildWidget

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

Description (last modified by bill)

I needed to empty my AccordionContainer? to reload w/ new data. When I remove the child which was selected, it failed in StackContainer?.js in removeChild(), in this block of code (line 144, I believe):

if(this._started){
			// in case the tab titles now take up one line instead of two lines
			// TODO: this is overkill in most cases since ScrollingTabController never changes size (for >= 1 tab)
			this.layout();
		}

layout() eventually results in a check to see if there's a selectedChildWidget, and if so, it resizes it. Because this call to layout() happens before selectedChildWidget is set to undefined, but after the selectedChildWidget's been partially deleted, the attempt to resize the half-deleted selectedChildWidget fails.

My proposed solution is to move the block of code pasted above to be below this block of code:

if(this.selectedChildWidget === page){
			this.selectedChildWidget = undefined;
			if(this._started){
				var children = this.getChildren();
				if(children.length){
					this.selectChild(children[0]);
				}
			}
		}

I'm planning to go live w/ my dojo-based site soon, so I have set this to "blocker."

Change History (2)

comment:1 Changed 9 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Owner: anonymous deleted
Priority: highnormal

I can't reproduce this. You'll need to attach a test case using the attach file button.

In test_AccordionContainer.html tried this in firebug against both 1.4 and 1.5, and it worked w/out error:

dijit.byId("markupAccordion").removeChild(dijit.byId("pane1"))

In 1.5, I also tried removing all the other children and that worked too:

dijit.byId("markupAccordion").removeChild(dijit.byId("lazyLoadPane"))
dijit.byId("markupAccordion").removeChild(dijit.byId("dijit_layout_BorderContainer_0"))
dijit.byId("markupAccordion").removeChild(dijit.byId("dijit_layout_ContentPane_2"))

comment:2 Changed 9 years ago by bill

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.