PDA

View Full Version : strange values by using DirectSubmit



cornfelt
21 Aug 2009, 2:37 AM
hallo,

I tried to read out a form with DirectSubmit, but when a submit is done I get strange values in POST.

I tested also the example of the api-docu but the same happened.

example:


var myFormPanel = new Ext.form.FormPanel({
// configs for FormPanel
title: 'Basic Information',
renderTo: document.body,
width: 300, height: 160,
padding: 10,
buttons:[{
text: 'Submit',
handler: function(){
myFormPanel.getForm().submit({
params: {
foo: 'bar',
uid: 34
}
});
}
}],

// configs apply to child items
defaults: {anchor: '100%'},
defaultType: 'textfield',
items: [{
fieldLabel: 'Name',
name: 'name',
value: "NAMANAMA"
},{
fieldLabel: 'Email',
name: 'email',
value: "maiaiaimaiail"

},{
fieldLabel: 'Company',
name: 'company',
value: "sdjfhsfdjfhij"
}],

// configs for BasicForm
api: {
submit: Ext.app.COMA_API_Contact.saveContactData }
});
the data packet for the server (POST):


{"action":"COMA_API_Contact","method":"saveContactData","data":[{"name":{"qtip":""},"email":{"qtip":""},"company":{"qtip":""}}],"type":"rpc","tid":6}
the server gets the this strange post-data too.

what is wrong or what can I do? I found nothing in this forums and with google.

thanks conrfelt

cornfelt
23 Aug 2009, 11:57 PM
is there anybody who has a hint or an answer?
it would be nice.

thanks, cornfelt

cornfelt
24 Aug 2009, 3:31 AM
at the serverside method has to be the following at php-doc



/**
* method description
*
* @remotable
* @formHandler
* @param array $data
* @return array
*/
public function someMethod($data)
{
// do something

return array(
'success' => true
);
}

Animal
24 Aug 2009, 4:10 AM
You are using some non-standard classes: "Ext.app.COMA_API_Contact"?

How can we know what you're doing?

cornfelt
24 Aug 2009, 4:34 AM
sorry,

for direct-handling on php-side we are using the code snippets of Tommy Maintz.

And so, the php-class "COMA_API_Contact" contains a public method "saveContactData" which contains the above mentioned content.

cornfelt