PDA

View Full Version : How to submit a form in multihost environments?



gero013
28 Jan 2011, 4:34 AM
Hello,

I'd like the idea of splitting the server jobs into file-service (html and js) and data-handling (json).
Reading data works fine with stores using ScriptTagProxy.

With forms I currently use this code

execForm: function(cmd) {
var f = this.getForm();

f.getEl().dom.action = VA.base.backend.URL + '/' + this.srvname + '?' + cmd;
f.getEl().dom.method = 'POST';
f.submit();
}
but obviously it does not work for cross-domain posts.
The server receives only OPTION-requests ... :(

I tried to use ScriptTagProxy with forms, but I did not succeed.
Is it possible to post cross-domain and if so, how could I solve it?

kind regards

Gero

dduffy
28 Jan 2011, 8:13 AM
cross domain Ajax can only be done with ScriptTagProxy, check out the following

http://aboukone.com/2011/01/07/of-extjs-scripttagproxy-spring-actions-treepanels-and-jsonstores/

gero013
28 Jan 2011, 8:39 PM
Hello,

thanks a lot for that link.
At first sight it looks quite intractable for me, but I'll try it ...

kind regards

Gero

techakone
30 Jan 2011, 9:09 AM
Hey Gero,
I blogged that post up there, so you can reach out if you need more help deciphering it.

gero013
30 Jan 2011, 9:19 AM
Hello,


I blogged that post up there, ... if you need more help deciphering it.

That's great - in deed! Thanks a lot!
I'm doing my first steps with JS actually, so I don't know yet, what's possible, or right or wrong ...
... but I'll gonna figure it out :)

kind regards

Gero

techakone
30 Jan 2011, 9:24 AM
Nice! my blog post up there was about getting data through cross domain calls but i actually implemented a cross domain post this week. i'll share the code a little bit later once i am done editing it.