PDA

View Full Version : [FIXED-EXTJSIV-198] DirectSubmit not sending data



mitchellsimoens
21 Mar 2011, 5:23 AM
I have checked this with the online form example

http://dev.sencha.com/deploy/ext-4.0-pr5/examples/direct/direct-form.html

If you press submit and look at the request, you will get this:


{
"action": "Profile",
"method": "updateBasicInfo",
"data": [
undefined,
null
],
"type": "rpc",
"tid": 5
}

evant
21 Mar 2011, 7:42 PM
Will be fixed in the next release.

rhapsodyv
16 Feb 2012, 5:59 AM
This error is happening for me in version extjs 4 beta 2.

I think I discovered part of the problem:

DirectSubmit.js:


doSubmit: function() {
var me = this,
callback = Ext.Function.bind(me.onComplete, me),
formEl = me.buildForm();
me.form.api.submit(formEl, callback, me);


It's tries send a form element but Connect.js don't detects it as a form upload:


isFormUpload: function(options) {
var form = this.getForm(options);
if (form) {
return (options.isUpload || (/multipart\/form-data/i).test(form.getAttribute('enctype'))); } return false;
},



So, it tries to encode the form element like a simple json object but it can't do it, so I get undefined in data field:


{"action":"Site","method":"login","data":[undefined],"type":"rpc","tid":1}


For now, I just changed me.buildForm() to me.getParams(). It's working fine because I don't need upload anything now, but it's just an workaround.

Thanks

rhapsodyv
16 Feb 2012, 6:16 AM
Just forget... My action didn't have the param formHandler... :-/

It could be more clear in the DirectSubmit documentation. Thanks. All working now.

[]s
Victor