0

I added dojo.connect statement like this,

dojo.connect(dojo.byId(this._paramsForm), "onChange", this, "_handleUpdate");

At this point, when I browser debug and check the values, this._paramsForm has valid values. But when the event is getting triggered, onChange function is not being called. There must be some problem in the dojo.connect statement, but not able to trace it.

Tried this one as well, No luck :(

dojo.connect(this._paramsForm, "onChange", this, "_handleUpdate");

Referred this link as well, no luck dojo.connect won't connect 'onclick' with button

But the same thing is working absolutely fine in Chrome and Firefox.

Please help me to fix this issue!

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user650521
  • 583
  • 1
  • 9
  • 23

1 Answers1

0

I think the way you are registering the event handler is wrong - try this:

require('dojo/_base/lang', 'dojo/on');

on(this._paramsForm, "change", lang.hitch(this, _handleUpdate));

Note that in the lastest versions, the prefix 'on' has been dropped - you just need to use 'click', 'change' etc; as the event names. lang.hitch - ensures that _handleUpdate is executed in the context of 'this'.

If you are using a older version of dojo (< 1.7), then the code will be similar:

dojo.connect(this._paramsForm, "onChange", dojo.hitch(this, _handleUpdate));
bugs_cena
  • 495
  • 5
  • 11