Ticket #5648 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

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

Reported by: StefanVE Owned by: bill
Priority: normal Milestone: 1.1
Component: Dijit Version: 1.0
Severity: normal Keywords:
Cc:

Description (last modified by bill) (diff)

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.

Testcode:

main.htm

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

<script>
function fixIt(){
 dijit.byId('mainTabContainer').startup();
 dijit.byId('mainTabContainer').resize();
}
</script>

_tabContainer.htm

<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>
</div>

Attachments

_minitabs.htm (292 bytes) - added by bill 10 months ago.
main.html (1.1 kB) - added by bill 10 months ago.

Change History

in reply to: ↑ description   Changed 10 months 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?

  Changed 10 months ago by bill

  • owner deleted
  • reporter changed from guest to StefanVE
  • component changed from General to Dijit
  • milestone set to 1.1

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 10 months ago by bill

Changed 10 months ago by bill

  Changed 10 months ago by bill

  • owner set to bill
  • status changed from new to assigned
  • description modified (diff)
  • summary changed from tabContainer not parsed after parent.refresh() is called to ContentPane: child widget not started after parent.refresh() or setHref() call

  Changed 10 months ago by bill

  • status changed from assigned to closed
  • resolution set to fixed

(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.