PDA

View Full Version : [SOLVED][Ext 3.0] FormPanel submit empty POST



aityahia
12 Oct 2009, 8:52 AM
This basic example work in ext V 2.2, the form is correctly submited and i can read my field value in server side.


var login = new Ext.FormPanel( {
url :'auth/login',
method :'POST',
defaultType :'textfield',
monitorValid :true,
items : [ {
fieldLabel :'Utilisateur',
id :'username',
name :'username',
allowBlank :false
}, {
fieldLabel :'Mot de passe',
id :'password',
name :'password',
inputType :'password',
allowBlank :false
}],

buttons : [ {
text :'Login',
formBind :true,
handler : function() {

login.getForm().submit()
}
} ]
});But with ext 3.0 i have an empty POST.

with this code i have my two parameters submited correctly

login.getForm().submit({params :
id :01
test:'jjjj'})there is any explication ?

:-? (standardSubmit) (http://www.extjs.com/deploy/dev/docs/output/Ext.form.BasicForm.html#Ext.form.BasicForm-standardSubmit)

Jack9
12 Oct 2009, 9:01 AM
Ext.onReady(function(){

Ext.QuickTips.init();

var login = new Ext.FormPanel( {
url :'auth/login',
method :'POST',
defaultType :'textfield',
monitorValid :true,
items : [{
fieldLabel :'Utilisateur',
id :'username',
name :'username',
allowBlank :false
}, {
fieldLabel :'Mot de passe',
id :'password',
name :'password',
inputType :'password',
allowBlank :false
}],
buttons : [
{
text :'Login',
formBind :true,
handler : function() {
login.getForm().submit()
}
}
]
});
var mainPanel = new Ext.Panel({
layout:'fit'
,height:500
,width:500
,items:[
login
]
});

mainPanel.render(document.body);
});


This code, submits the values correctly. Standard submit does an automatic redirect to the submission target (auth/login) just like a vanilla HTML submit. I don't know if you want that or not.

aityahia
12 Oct 2009, 11:58 PM
Problem resloved, i have this in my FormPanel header


el: 'login-box'