#17161 closed defect (duplicate)
RoundRectList: cannot use on() for methods introduced by editableMixinClass
Reported by: | Paul Christopher | Owned by: | Adrian Vasiliu |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | DojoX Mobile | Version: | 1.9.0 |
Keywords: | Cc: | bill | |
Blocked By: | Blocking: |
Description
Description
See attached test case: It seems that you cannot connect to onXX methods introduced by mixins. E.g. look at dojox/mobile/EdgeToEdgeList which is made editable by setting "editable:true". This causes dojox/mobile to require _EditableListMixin and mix it in using safeMixin (RoundRectList's postCreate method line 94). However connecting to "onDeleteItem" using the syntax
mylist.on('deleteitem', function(){...});
does not work.
The reason is twofold as far as I can see as a newbie:
- On the one hand, after the safeMixin has happend, "this.constructor._onMap" is not reset in order to make _WidgetBase's _onMap search for new entries.
- On the other hand, searching by _onMap is not successful, since _onMap only searches in "this.constructor.prototype". But the OnDeleteItem method is part of "this" only and not "this.constructor.prototype".
Attachments (1)
Change History (6)
Changed 8 years ago by
Attachment: | test_on.html added |
---|
comment:1 Changed 8 years ago by
Component: | Dijit → DojoX Mobile |
---|---|
Owner: | changed from bill to Eric Durocher |
Summary: | Cannot use widget.on for methods introduced by mixins → RoundRectList: cannot use on() for methods introduced by editableMixinClass |
comment:2 Changed 8 years ago by
Bill, that's great: Using "on" with data-dojo-mixins works perfectly!
comment:3 Changed 8 years ago by
Note that this ticket is a duplicate of https://bugs.dojotoolkit.org/ticket/16709
comment:4 Changed 8 years ago by
Cc: | bill added |
---|---|
Owner: | changed from Eric Durocher to Adrian Vasiliu |
Status: | new → assigned |
comment:5 Changed 8 years ago by
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
- For the future (Dojo 2.0...), the intention is indeed, as Bill said, to go for
<ul data-dojo-id="list" data-dojo-type="dojox/mobile/EdgeToEdgeList" data-dojo-mixins="dojox/mobile/dojox/mobile/_EditableListMixin"> </ul>
- Being a duplicate of #16709, I close it as such.
Note: See
TracTickets for help on using
tickets.
Thanks for the test case, and summary. I think you are right about what's happening.
So, I think mixins work fine generally, but (as you said) it's just the unusual thing that RoundRectList.postCreate() does where they don't work:
This is irregular because:
I can see why dojox/mobile wanted to do it this way, but it's not something dijit ever meant to support, and ISTM the best approach for applications may be to just do:
instead of
Mobile guys, what do you think? Close this as wontfix and mark the editable and editableMixinClass properties as deprecated?