Opened 8 years ago
Closed 7 years ago
#17173 closed defect (invalid)
error extending dojox.form.manager._mixin.js
Reported by: | vtsuper | Owned by: | vtsuper |
---|---|---|---|
Priority: | high | Milestone: | 1.9.2 |
Component: | DojoX Form | Version: | 1.9.0 |
Keywords: | Cc: | bitpshr | |
Blocked By: | Blocking: |
Description
when I extend dojox.form.manager._mixin.js, firebug will prompt the following error.
"TypeError?: widget.getDescendants is not a function"
once I change the line 227 in _Mixin.js to this var widgets = array.map(widget.getChildren(), registerWidget, this);
the error seems solved.
Change History (10)
comment:1 Changed 8 years ago by
Cc: | bitpshr added |
---|---|
Milestone: | tbd → 1.9.1 |
Owner: | set to dylan |
Priority: | undecided → high |
Status: | new → assigned |
comment:2 Changed 8 years ago by
comment:3 Changed 8 years ago by
Summary: | extend dojox.form.manager._mixin.js → error extending dojox.form.manager._mixin.js |
---|
vtsuper - what's your test case? Is this something that worked in an earlier release?
comment:4 Changed 8 years ago by
Owner: | changed from dylan to vtsuper |
---|---|
Status: | assigned → pending |
comment:5 Changed 8 years ago by
Status: | pending → new |
---|
here are my widget (reference http://dojo-toolkit.33424.n3.nabble.com/Templated-dojox-form-Manager-problem-tp908864.html)
define(["dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin","dijit/_WidgetsInTemplateMixin", "dojox/form/manager/_Mixin","dojox/form/manager/_ClassMixin","dojox/form/manager/_FormMixin","dojox/form/manager/_NodeMixin","dojox/form/manager/_EnableMixin","dojox/form/manager/_ValueMixin","dojox/form/manager/_DisplayMixin","dojo/text!./templates/Frm.html" ], function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Mixin, _ClassMixin, FormMixin, _NodeMixin, _EnableMixin, _ValueMixin, _DisplayMixin,template ){ return declare("custom.Frm", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Mixin, _ClassMixin,FormMixin,_NodeMixin,_EnableMixin,_ValueMixin,_DisplayMixin], { templateString : template, }); });
Frm.html
<div style="width:100%; height:100%;"> <h6>testing</h6> <form data-dojo-type="dijit/form/Form" data-dojo-attach-point="form"> <div data-dojo-attach-point="containerNode" class="frm"></div> </form> </div>
comment:6 follow-up: 7 Changed 8 years ago by
I found some hints about this case.
this code is failed
define(["dojo/_base/declare", "dijit/_WidgetBase"..................
this code is worked
define(["dojo/_base/declare", "dijit/_Widget", "dijit/_WidgetBase"..................
according to my understanding, _Widget is deprecated and replaced by _WidgetBase soon. So I extend from _WidgetBase directly, but _WidgetBase seems hasn't got "getDescendants" method that dojox.form.manager was called.
so it is the problem of dojox.form.manager or _WidgetBase???
comment:7 Changed 8 years ago by
Replying to vtsuper:
so it is the problem of dojox.form.manager or _WidgetBase???
I'd say the problem is in your custom code. Dojox.form.manager._mixin requires that you extend _Widget, and yet you are extending _WidgetBase. Of course, that should be documented better.
It's true that we planned to eventually replace _Widget by _WidgetBase, but that doesn't mean that code that depends on _Widget is broken; it just means that it hasn't been upgraded yet.
comment:8 Changed 8 years ago by
then it is not a bug, I misunderstand the document. _WidgetBase will be replace _Widget soon, but not now. And we should extend _Widget, and _WidgetBase at this moment.
sorry about that. this case should be closed.
comment:9 Changed 8 years ago by
Milestone: | 1.9.1 → 1.9.2 |
---|
1.9.1 is released; moving all outstanding tickets to next milestone.
Note that getChildren() and getDescendants() do different things if there are nested widgets.
You must be mixing in _Mixin to [a superclass of] _WidgetBase, rather than [a superclass of] _Widget, hence getDescendants() is not available. I'm not sure that qualifies as a bug, rather than a limitation of _Mixin, but I guess it would be nice to eliminate the limitation.