Opened 16 years ago

Last modified 9 years ago

#1983 closed feature

widgetsInTemplate does not process nested widgets — at Version 6

Reported by: [email protected] 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 bill)

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:

  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; }

Change History (9)

comment:1 Changed 16 years ago by bill

You need to supply a testcase w/javascript file, template file, and test html file.

Changed 16 years ago by promag

Attachment: test_widgetsInTemplate.html added

Changed 16 years ago by promag

Changed 16 years ago by promag

This simple test shows that wrapped sub widgets aren't attached

comment:2 Changed 15 years ago by dylan

Component: GeneralWidgets
Milestone: 0.9
Owner: changed from anonymous to bill

comment:3 Changed 15 years ago by bill

Component: WidgetsDijit
Milestone: 0.91.0
Owner: changed from bill to liucougar

comment:4 Changed 15 years ago by bill

Milestone: 1.02.0

comment:5 Changed 14 years ago by alex

Milestone: 2.01.3

Milestone 2.0 deleted

comment:6 Changed 14 years ago by bill

Description: modified (diff)
Milestone: 1.3future
Summary: widgetsInTemplate does not process new widgets created dynamicallywidgetsInTemplate does not process nested widgets
Type: defectenhancement

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.

Note: See TracTickets for help on using tickets.