Georgioa
24 Jun 2009, 6:51 AM
Hi
I'm in troubles with ExtDirect and foms.
I'm trying to send a little form with 2 textFields to my server. The server has to respond :
Welcome FirstParam SecondParam !
Here is my test code :
Ext.onReady(function(){
Ext.Direct.addProvider(Ext.app.REMOTING_API);
var testForm = new Ext.FormPanel({
labelWidth:80,
frame:false,
defaultType:'textfield',
paramOrder: ['lastName','firstName'],
api:{
submit:TestDirect.getWelcome
},
items:[{
id:'lastName',
fieldLabel:'Nom',
name:'lastName',
allowBlank:false
},{
id:'firstName',
fieldLabel:'Prénom',
name:'firstName',
allowBlank:false
}],
buttons:[{
text:'Welcome',
handler:function(){
testForm.getForm().submit();
}
}]
});
testForm.render(document.body);
Ext.Direct.on('exception', function(e){
alert(e.type + " : " + e.message);
console.log(e);
});
});
When i clic on my button, my POST is :
{"action":"TestDirect","method":"getWelcome","data":[{"lastName":"qtip":""},"firstName":{"qtip":""}}],"type":"rpc","tid":2}
How can i send my textfields values to the server?
I tried to do like it was explained in this post (http://extjs.com/forum/showthread.php?t=71339), but i cant get it work !
Best regards
Georgio
I'm in troubles with ExtDirect and foms.
I'm trying to send a little form with 2 textFields to my server. The server has to respond :
Welcome FirstParam SecondParam !
Here is my test code :
Ext.onReady(function(){
Ext.Direct.addProvider(Ext.app.REMOTING_API);
var testForm = new Ext.FormPanel({
labelWidth:80,
frame:false,
defaultType:'textfield',
paramOrder: ['lastName','firstName'],
api:{
submit:TestDirect.getWelcome
},
items:[{
id:'lastName',
fieldLabel:'Nom',
name:'lastName',
allowBlank:false
},{
id:'firstName',
fieldLabel:'Prénom',
name:'firstName',
allowBlank:false
}],
buttons:[{
text:'Welcome',
handler:function(){
testForm.getForm().submit();
}
}]
});
testForm.render(document.body);
Ext.Direct.on('exception', function(e){
alert(e.type + " : " + e.message);
console.log(e);
});
});
When i clic on my button, my POST is :
{"action":"TestDirect","method":"getWelcome","data":[{"lastName":"qtip":""},"firstName":{"qtip":""}}],"type":"rpc","tid":2}
How can i send my textfields values to the server?
I tried to do like it was explained in this post (http://extjs.com/forum/showthread.php?t=71339), but i cant get it work !
Best regards
Georgio