Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5865 closed defect (fixed)

ContentPane extending widgets: can't use widgetsInTemplate

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

Description (last modified by bill)

ContentPane.setContent() calls destroyDescendants() which searches for all widgets in this.domNode. Thus if you modify TitlePane to have a button widget in the title bar, setContent() will destroy it, which is incorrect.

In general I guess destroyDescendants() should just look in this.containerNode.

OTOH, it would be nice for _Templated to cleanup all the widgets it created via the widgetsInTemplate functionality.

Refs IBM-79976.

Change History (4)

comment:1 Changed 11 years ago by bill

Milestone: 1.1

comment:2 Changed 11 years ago by bill

Description: modified (diff)

comment:3 Changed 11 years ago by bill

Resolution: fixed
Status: newclosed

(In [12726]) Make destroyDescendants() just work on this.containerNode, so that embedded widgets like FloatingPane?'s resize handle don't get destroyed by doing FloatingPane?.setContent(). Added this._supportingWidgets attribute to hold widgets created as part of template, so they can be destroyed when the main widget is destroyed. In the future could also leverage this._supportingWidgets to hold other supporting widgets like FloatingPane?'s resizeHandle or TabContainer?'s tab list. Fixes #5865. (!strict to avoid spurious warnings about nested function)

comment:4 Changed 11 years ago by bill

(In [12817]) Make getDescendants() and destroyDescendants() work for ContentPane?. I'm requiring that all nodes with descendants define this.containerNode, which is generally not an issue except for ContentPane?, since it doesn't have a template, so can't simply do dojoAttachPoint="containerNode". Works fine for TitlePane? though, for example. Refs #5865. (!strict to avoid spurious warnings about nested function)

Note: See TracTickets for help on using tickets.