Opened 7 years ago

Closed 7 years ago

#16105 closed defect (fixed)

EdgeToEdgeDataList doesn't remove itself from registry properly if editable is true

Reported by: jonferraiolo Owned by: Eric Durocher
Priority: undecided Milestone: 1.8.2
Component: DojoX Mobile Version: 1.8.0
Keywords: Cc: cjolif
Blocked By: Blocking:

Description

We discovered this in Maqetta, where we provide a convenient user interface for users to turn the 'editable' property on and off by simply clicking on a checkbox in our properties palette.

What's going on with EdgeToEdgeDataList? is that if the editable property is true, the widget mixes in _EditableListMixin.js, which includes a destroy method. If you then try to destroy the EdgeToEdgeDataList?, and recreate a new widget using the same ID as what was supposed to be destroyed, Dojo throws this error:

Uncaught Error: Tried to register widget with id==foo but that id is already registered

The reason for this is that the custom destroy() method doesn't update dijit.registry. The destroy() method in _EditableListMixin.js does indeed include a this.inherited(arguments), but _EditableListMixin.js isn't a descendant of _WidgetBase, so the _WidgetBase destroy method is never called.

The attached sample app produces the exception

Attachments (2)

EdgeToEdgeDataListEditableBug.html (1.9 KB) - added by jonferraiolo 7 years ago.
16105.patch (513 bytes) - added by Eric Durocher 7 years ago.
Add _EditableListMixin using declare.safeMixin() so destroy() works correctly - Eric Durocher (IBM, CCLA)

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by jonferraiolo

comment:1 Changed 7 years ago by Eric Durocher

Correct, this.inherited() does not work because the mixin is added using lang.mixin. Using declare.safeMixin() instead fixes the problem. Thanks for finding this.

Last edited 7 years ago by Eric Durocher (previous) (diff)

Changed 7 years ago by Eric Durocher

Attachment: 16105.patch added

Add _EditableListMixin using declare.safeMixin() so destroy() works correctly - Eric Durocher (IBM, CCLA)

comment:2 Changed 7 years ago by Adam Peller

Eric, could we consider this trivial patch for 1.8? It seems to be a regression, as we had this working against 1.7

comment:3 Changed 7 years ago by Eric Durocher

Cc: cjolif added

No problem with me.

comment:4 Changed 7 years ago by Adam Peller

Milestone: tbd1.8.2

ok, tagging as 1.8.2 just so we don't forget to consider. Eric, please push back if you think this is a problem.

comment:5 Changed 7 years ago by cjolif

Fixed in trunk in [29845]

comment:6 Changed 7 years ago by cjolif

Resolution: fixed
Status: newclosed

In [29846]:

fixes #16105. Add _EditableListMixin using declare.safeMixin() so destroy() works correctly - Eric Durocher (IBM, CCLA). !strict

Note: See TracTickets for help on using tickets.