PDA

View Full Version : Problem with form params and ExtDirect



steffenk
14 Mar 2010, 8:21 AM
Hi,

i have the following problem:

FormLoad
works fine as long i don't use formHandler: true in api.

without formHandler setting:
sent: {"action":"ExtDirect","method":"loadUploadExtToTer","data":null,"type":"rpc","tid":4}
receive: {"type":"rpc","tid":4,"action":"ExtDirect","method":"loadUploadExtToTer","result":{"success":true,"data":{"fe_u":"user","fe_p":"password"}}}

with formHandler setting:
error: form.getAttribute is not a function

Form submit
with formHandler setting:
server side exception, sent is a POST array like

extAction ExtDirect
extKey context_help
extMethod uploadExtToTer
extTID 5
extType rpc
extUpload false
fe_p password
fe_u user

without formHandler setting:
sent: {"action":"ExtDirect","method":"uploadExtToTer","data":[{}],"type":"rpc","tid":5}

So basically i get what i need without formHandler setting, but with submit, no form data is in the "data" object.

I also played with paramsAsHash, but this seems only something for load, it has to be false in this situation to work.
i use:

api: {
load: TYPO3.EM.ExtDirect.loadUploadExtToTer,
submit: TYPO3.EM.ExtDirect.uploadExtToTer
},
paramsAsHash: false,
baseParams: {extKey: record.data.extkey},

What do i miss, why doesn't formHandler work, how to get formValues in data-object?

Thanks for taking the time.

steffenk
14 Mar 2010, 5:03 PM
The problem was the scope with form submit.

i now rewrote the FormPanel so scope is the form in handler where i do the submit.

now i get this error which doesn't help me a lot:


uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://em.local.com/typo3/contrib/extjs/adapter/ext/ext-base-debug.js :: asyncRequest :: line 2590" data: no]

steffenk
14 Mar 2010, 5:38 PM
ok, solved above problem by applying the settings in onRender


onRender: function() {


TYPO3.EM.TerUpload.superclass.onRender.apply(this, arguments);

Ext.apply(this.getForm(),{
api: {
load: TYPO3.EM.ExtDirect.loadUploadExtToTer,
submit: TYPO3.EM.ExtDirect.uploadExtToTer
},
paramsAsHash: false

});
this.form.load();
}

but problem with missing formVals in post json data remain.

steffenk
15 Mar 2010, 9:39 AM
Finally we changed the API Implementation in TYPO3 to work with formHandler setting and all works fine now, so problem is solved.

Maybe, if someone knows why the hash is empty, feel free to answer.