Opened 14 years ago

Closed 14 years ago

#5648 closed defect (fixed)

ContentPane: child widget not started after parent.refresh() or setHref() call

Reported by: StefanVE Owned by: bill
Priority: high Milestone: 1.1
Component: Dijit Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

If you load a template containing TabContainer into a contentPane (href or setHref()) it works fine the first time. But if you do a contentPane.refresh(), or a new setHref(), the tabs are no longer there. Other widgets in the template are parsed, but not the tabs. Calling tabContainer.startup() and tabContainer.resize() makes them appear again (thanks psychcf). Calling destroyRecursive() on tabContainer or destroyDescendants() on contentPane prior to loading a new tabcontainer does not help.



<div id="fake" dojoType="dijit.layout.ContentPane"  href="_tabContainer.htm">
<div onclick="dijit.byId('fake').refresh()">Refresh tabs</div>
<div onclick="fixIt()">Run fix</div>

function fixIt(){


<div id="mainTabContainer" dojoType="dijit.layout.TabContainer">
	<div dojoType="dijit.layout.ContentPane" title="Tab 1" id="tab1">Content always visible</div>
	<div dojoType="dijit.layout.ContentPane" title="Tab 2" id="tab2">But the tabs not...</div>

Attachments (2)

_minitabs.htm (292 bytes) - added by bill 14 years ago.
main.html (1.1 KB) - added by bill 14 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 in reply to:  description Changed 14 years ago by guest

Replying to guest:

Interesting, maybe, is that if one puts an empty div (<div></div>) before the mainTabContainer it refreshes ok without need of a manual startup + resize. We had also similar problem with first button on a toolbar that did not manage to make a dojo/connect. When adding a char (like 'i') before the button, it initialized correctly. Seems like the parser have problem with the first object?

comment:2 Changed 14 years ago by bill

Component: GeneralDijit
Milestone: 1.1
Owner: anonymous deleted
Reporter: changed from guest to StefanVE

Whenever you use layout widgets you need to specify a size. In this case you need to specify a size on the ContentPane? with the href, which will then size the TabContainer?. So attaching updated test case for that.

That actually demonstrated another problem with initial display of the content pane.

The original problem in this bug report is about startup() not getting called on the child widget after you do a setHref().

Will checkin fix to both problems.

Changed 14 years ago by bill

Attachment: _minitabs.htm added

Changed 14 years ago by bill

Attachment: main.html added

comment:3 Changed 14 years ago by bill

Description: modified (diff)
Owner: set to bill
Status: newassigned
Summary: tabContainer not parsed after parent.refresh() is calledContentPane: child widget not started after parent.refresh() or setHref() call

comment:4 Changed 14 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [12160]) Fixes #5648:

  • child widget not started after parent.refresh() or setHref() call
  • top level ContentPane? will pass bogus size argument to child.resize() (but works if ContentPane? is child of a layout container)

Also has the start of some code to control when ContentPane? acts (or doesn't act) as a layout container, sizing it's child widget.

Note: See TracTickets for help on using tickets.