PDA

View Full Version : window + form panel bug



italoc
10 Aug 2009, 3:51 AM
there is a bug when submit a form panel in a window

this is my code and work great under ext 2.2.1



var tabs = new Ext.FormPanel({
xtype: 'form',
region: 'center',
method: 'POST',
name: 'sendlinkform',
id: 'sendlinkform',
buttonAlign: 'center',
fileUpload: true,
labelWidth: 100,
defaults: {
width: 250
},
frame: true,
// errorReader: new Ext.form.XmlErrorReader(),
defaultType: 'textfield',
items: [{
fieldLabel: 'Nome',
id: 'nome',
name: 'nome',
allowBlank: false
}],
buttons: [{
text: 'Invia',
handler: function(){
if (tabs.getForm().isValid()) {
tabs.getForm().submit({
url: '../../framework/ci/index.php?c=external&m=sendLink',
success: function(){
Ext.MessageBox.show({
title: 'Messaggio Spedito...',
msg: 'Il messaggio è stato correttamente spedito.',
buttons: Ext.MessageBox.OK,
animEl: 'animation',
icon: Ext.MessageBox.INFO
});
winLink.hide();
},
failure: function(){
Ext.Msg.alert('Invio Fallito', 'Il messaggio non è stato correttamente spedito, riprova.');
//win.hide();
}
});

}
}
}]

}

var winLink = new Ext.Window({
title: 'Invia la tua posizione..',
closeAction: 'hide',
closable: true,
width: 630,
height: 400,
plain: true,
layout: 'border',
items: [tabs]
})


i receive this error "ext-all.js line 7"

can you help me?

where is my error? or is a real bug?

thank you

Animal
10 Aug 2009, 3:58 AM
Use ext-all-debug.js

Join date Feb 2008, and you've never wondered what ext-all-debug.js is or what it's for?

Then post the WHOLE error.

italoc
10 Aug 2009, 7:18 AM
ok sorry...

this is the error:

"syntax error"
ext-all-debug.js (riga 11527)
doDecode = function(json){
return eval("(" + json + ')');
},

Animal
10 Aug 2009, 7:20 AM
Right.

So it's throwning an error when evaluating a response from a form submit.

So you you immediately look at Firebug to check your JSON to see if its valid.

And?...

Animal
10 Aug 2009, 7:21 AM
It's a file upload.

I assume you read the very carefully worded API docs about file uploads.

I added the extra info in all places in the API docs that uploads are mentioned, so go and read.

italoc
10 Aug 2009, 7:33 AM
i dont' use json in this submit...

but yes it is fileupload

the upload work succesfully in server side, but i obtain and error...

Animal
10 Aug 2009, 7:41 AM
And so what doe the API docs say about uploading?

italoc
10 Aug 2009, 8:15 AM
i have read the api

i don't use JSON i don't submit HTMLENTITES..

but don't work...

what is changed from extjs 2.2.1?

italoc
10 Aug 2009, 8:26 AM
ok now works..

the real problem is the endocing of my php framework..

sorry