#7334 closed defect (wontfix)
StackContainer: does not call addChild for panes in markup
Reported by: | dante | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | Dijit | Version: | 1.1.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
If you are subclassing StackContainer, and your subclass relies on addChild notifying you about any and all children that pass through the StackContainer, you are forced to use a private method _setupChild.
this only happens in a random edge case somewhere between markup-only and programmatic instantiation, as startup() is called on the Tab by the parser, which calls _setupChild exclusively, or programatically adding the new panes via addChild.
solutions: make _setupChild public, and support the API: setupChild(widget) or have startup in TabContainer call addChild. The latter is safer.
Attachments (1)
Change History (4)
Changed 12 years ago by
Attachment: | tab-setTitle.html added |
---|
comment:1 Changed 12 years ago by
to note: this came up as a user question about the Campus article: http://dojocampus.org/content/2008/06/06/hacking-tabcontainer-settitle-extension/
The example uses addChild, but changing it to _setupChild safely solves the issue in the testCase. The 'issue' is the underscore, ultimately.
comment:2 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Yah.. I think of _setupChild() as protected, not private. (I know we unfortunately have no way of denoting the difference; I'd like to add that to the doc at some point.)
I agree that addChild() not being called for the initial children is confusing, but seemed unavoidable (hence why we made the _setupChild() method in the first place). IIRC it was a performance issue, at least for widgets like BorderContainer.
Anyway, I understand the sentiment to make _setupChild() public but I don't want to do it, because then non-experts users might try call setupChild(), or try something like <div dojoType=TabContainer setupChild="alert(...)">
(since that works for onClick on a Button) but obviously wouldn't work here.
comment:3 Changed 12 years ago by
Fair enough ... I'll add this note to the StackContainer? and TabContainer? documentation.
test illustrating issue