Opened 12 years ago

Closed 12 years ago

#10670 closed defect (wontfix)

Dojo 1.4 _LayoutWidget.js change breaks TabContainer inside a ContentPane

Reported by: macmillan Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.4.0
Keywords: _LayoutWidget TabContainer Cc: [email protected]
Blocked By: Blocking:


In Dojo release 1.4, The following change has been made to the startup() method of the _LayoutWidget.js

if(!(parent && parent.isLayoutContainer)){

In the 1.3 release, the 'if' statement surrounding the resize() call was not present.

The impact of this is that if a TabContainer? widget is placed inside a ContentPane?, for example, then the TabContainer? may not initialise properly.

This is because the overriden resize() method of the StackContainer? is responsible for Calling showChild(selected) which changes the selected tab content pane from hidden to visible.

As resize is now not called (because it has a parent Layout container), the selected content pane will remain hidden, and the left, right and menu icons do not get set correctly.

The attached example shows the issue. With the 1.3 CDN everything is fine. With the 1.4 CDN, the issue appears

Attachments (1)

ProgrammaticTabContainerTest.html (1.6 KB) - added by macmillan 12 years ago.
Test case showing TabContainer? issue when placed inside a ContentPane?

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by macmillan

Test case showing TabContainer? issue when placed inside a ContentPane?

comment:1 Changed 12 years ago by Adam Peller

Milestone: tbd1.4.1

comment:2 Changed 12 years ago by Adam Peller

possible regression from [19496]

comment:3 Changed 12 years ago by bill

Milestone: 1.4.1tbd
Resolution: wontfix
Status: newclosed

Thanks or attaching a test case. This is an often asked question.

The problem is that you are setting the content of the ContentPane in a non-standard way, specifically:, dojo.byId("tabContainerPlaceHolder"), "last");

If you use the standard way

myContentPane.attr("content", tabContainer);

then it will work fine.

Since (as you alluded to in the description) ContentPane is acting as a layout widget, TabContainer properly waits for ContentPane to call resize() on it. So ContentPane needs to know that it has a child, you can't set a child secretly.

If you don't want to set the ContentPane content in the way listed above for some reason then you need to call ContentPane.resize() after inserting the TabContainer.

Note: See TracTickets for help on using tickets.