View Full Version : UpdateManager.formUpdate bug when setting reset to true ?

7 Feb 2007, 7:52 AM
When using the formUpdate method of the updateManager I noticed the form was not reset properly.

After some hunting around I found that the method does not work (at least with FF 2).

The call is such


An execption is thrown on that since
response.argument.form is a string of the element'd id and thus the call fails.



yields better results.

It seems weird though so I would welcome any info on this.

7 Feb 2007, 8:11 AM
Arnaud -

I had noticed this same bug a few weeks ago when completing a little app with the formUpdate method. When passing true to the optional form reset bool it doesn't seem to work. I didn't have time to dig into the problem but what I did was just listen to the 'update' event and reset the form that way.

myUpdateMgr.on('update', this.resetForm.createDelegate(this));

Hopefully this will be fixed in the upcoming release or someone else can let us know what we're doing wrong


7 Feb 2007, 9:01 AM
Good catch.

It's setting up the argument wrong.

formUpdate : function(form, url, reset, callback){
if(this.beforeUpdate.fireDirect(this.el, form, url) !== false){
formEl = YAHOO.util.Dom.get(form);
if(typeof url == 'function'){
url = url();
if(typeof params == 'function'){
params = params();
url = url || formEl.action;
var callback = {
success: this.successDelegate,
failure: this.failureDelegate,
timeout: (this.timeout*1000),
argument: {'url': url, 'form': form, 'callback': callback, 'reset': reset} // <-- should be formEl.
var isUpload = false;
var enctype = formEl.getAttribute('enctype');
if(enctype && enctype.toLowerCase() == 'multipart/form-data'){
isUpload = true;
YAHOO.util.Connect.setForm(form, isUpload, this.sslBlankUrl);
this.transaction = YAHOO.util.Connect.asyncRequest('POST', url, callback);

8 Feb 2007, 1:01 AM
Thanks guys. I've changed it to point to formEl.

29 Jun 2007, 5:07 AM
i think this bug is back (1.1beta1 and 1.1beta2)... a little different

please take a look at: http://extjs.com/forum/showthread.php?t=8413