tags:

views:

70

answers:

1

I have a onsubmit dojo/method within a custom templated widget like so:

try { if (this.validate()) { //console.debug(this); SubmitForm(dojo.hitch(this, this.Send)); } } catch (e) { console.debug(e); } return false;

When I call this, the scope within the dojo/method is dijit.Form. How would I go about getting the scope of the template widget instead?

A: 

I solved it by doing this:

dojo.connect(dojo.byId(this.form.id), "onsubmit", dojo.hitch(this, function(e) { e.preventDefault(); if (this.GetForm().validate()) { SubmitForm(dojo.hitch(this, this.Send)); } }) );

Justin