Opened 14 years ago
Closed 8 years ago
#1983 closed feature (fixed)
widgetsInTemplate does not process nested widgets
Reported by: | Owned by: | liucougar | |
---|---|---|---|
Priority: | low | Milestone: | 1.0 |
Component: | Dijit | Version: | 0.4 |
Keywords: | widgetsInTemplate sub widgets | Cc: | |
Blocked By: | Blocking: |
Description (last modified by )
Sub widgets that are wrapped by, for instance, accordion panes or split panes, aren't processed. So dojoAttachPoint or dojoAttachEvent are ignored for those sub widgets.
I fixed by setting an attribute on nodes (watermark) and then check for the mark. If there is no mark, then its a wrapper widget (or something like that), so lets process its children.
On DomWidget?.js near line 586 I made:
if(subnodes[i].getAttribute('dojoType')){ subnodes[i].setAttribute('_isSubWidget', true); } subnodes[i].setAttribute('_watermark', true);
and near line 618 change to:
if(cwidget.extraArgs['_watermark'] && (cwidget._processedSubWidgets || !cwidget.extraArgs['_issubwidget'])){ continue; }
Attachments (4)
Change History (14)
comment:1 Changed 14 years ago by
Changed 14 years ago by
Attachment: | test_widgetsInTemplate.html added |
---|
Changed 14 years ago by
Attachment: | test_widgetsInTemplate.2.html added |
---|
Changed 14 years ago by
Attachment: | test_widgetsInTemplate.3.html added |
---|
This simple test shows that wrapped sub widgets aren't attached
comment:2 Changed 14 years ago by
Component: | General → Widgets |
---|---|
Milestone: | → 0.9 |
Owner: | changed from anonymous to bill |
comment:3 Changed 14 years ago by
Component: | Widgets → Dijit |
---|---|
Milestone: | 0.9 → 1.0 |
Owner: | changed from bill to liucougar |
comment:4 Changed 14 years ago by
Milestone: | 1.0 → 2.0 |
---|
comment:6 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Milestone: | 1.3 → future |
Summary: | widgetsInTemplate does not process new widgets created dynamically → widgetsInTemplate does not process nested widgets |
Type: | defect → enhancement |
I've got a feeling that we will switch to using the DTL code before addressing this issue.
For now, you just need to workaround by creating widgets like the TabContainer and it's children programatically, and then attaching them under your widget.
comment:7 Changed 8 years ago by
Priority: | high → low |
---|
comment:8 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
There are many solutions, but also some challenges with nested or subwidgets.
I'm going to close this as wontfix, because I think we've gone as far as we can reasonably go with the approach to nesting widgets in the 1.x codebase.
comment:9 Changed 8 years ago by
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
This is still something I want to look at, although not for 1.9.
comment:10 Changed 8 years ago by
Milestone: | future → 1.0 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
Type: | enhancement → feature |
Actually, this already works well, and I think it's worked since 1.0. The only failures in the test case, when updated for 1.0, are:
- The infinite recursion test (test 2): we aren't supposed to support that.
- The dojoAttachPoint inside the button (in test 3). The way dijit/form/Button::_fillContent() copies the srcNodeRef.innerHTML to this.label isn't compatible with having dojoAttachPoint inside a button.
Changed 8 years ago by
Attachment: | widgetsInTemplate1.0.html added |
---|
test case updated to run against 1.0 (and 1.9)
You need to supply a testcase w/javascript file, template file, and test html file.