Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16781 closed feature (fixed)

_AttachMixin: support container widgets

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.9
Component: Dijit Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description

Presumably _AttachMixin doesn't handle widgets with a containerNode, because it will traverse into the containerNode looking for data-dojo-attach-point and data-dojo-attach-event nodes.

For example, assume the index.html page has:

<div data-dojo-type=ServerTitlePane>
      <div data-dojo-attach-point=titleBar>the title</div>
      <div data-dojo-attach-point=containerNode>
             <span data-dojo-type=ServerButton>
                  <span data-dojo-attach-event="onclick: _onClick">click me</span>
             </span>
      </div>
</div>

where ServerTitlePane and ServerButton extend _AttachMixin (but do not extend _WidgetsInTemplateMixin). When the ServerTitlePane tries to instantiate, it will presumably try to process the

<span data-dojo-attach-event="onclick: _onClick">click me</span>

and then get an exception because there's no _onClick method in ServerTitlePane.

I assume _AttachMixin has to use an algorithm like dijit/registry::findWidgets(), skipping anything beneath the containerNode. Hopefully that won't degrade performance much for the common case when templates are substituted on the client side.

Change History (2)

comment:1 Changed 7 years ago by bill

Resolution: fixed
Status: newclosed

In [30733]:

Fix _AttachMixin to (by default) not scan DOMNodes inside this.containerNode. Also modify _AttachMixin tests that assumed the opposite behavior. Leaving _TemplatedMixin with the old behavior for backwards compatibility of widget like _ComboBoxMenu that have templates with markup inside of this.containerNode. Fixes #16781, refs #16576 !strict.

comment:2 Changed 7 years ago by bill

Milestone: tbd1.9
Note: See TracTickets for help on using tickets.