Opened 8 years ago
Closed 8 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)
Change History (8)
Changed 8 years ago by
Attachment: | EdgeToEdgeDataListEditableBug.html added |
---|
Changed 8 years ago by
Attachment: | 16105.patch added |
---|
Add _EditableListMixin using declare.safeMixin() so destroy() works correctly - Eric Durocher (IBM, CCLA)
comment:2 Changed 8 years ago by
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:4 Changed 8 years ago by
Milestone: | tbd → 1.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.
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.