Hi Derrell,

 

but I meant to make an ordinary post request like formulars do. Not using
any ajax request. Sometimes you have to jump to an another webpage or even
open a new window/tab. I need this peace of code for my
qx.application.Inline project.

 

 


 


SAKsystems

Inh. Mustafa Sak

Varrelmannstr. 16

30453 Hannover

Tel.   +49 511 / 165 969 40

Fax   +49 511 / 165 969 49

Mobil +49 163 / 312 6144

http://www.saksys.de

 <mailto:[email protected]> [email protected]

STEUER-Nr. 2613817458

 

  _____  

Von: Derrell Lipman [mailto:[email protected]] 
Gesendet: Dienstag, 5. Juli 2011 17:16
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] Enhancement: post request

 

 

On Tue, Jul 5, 2011 at 11:01, Mustafa Sak <[email protected]> wrote:

Hi list,

 

what do you think? Would it be useful to have a function at qx to send post
request?

 

qx.io.remote.Request can be used to issue a POST request. That's how RPC
works. Just specify "POST" as the second parameter to the Request
constructor, and add your data to the request with request.setData().

 

You can also use request.setFormFields(), which will cause the IFrame
transport to be used instead of the XMLHttp transport, and it will submit a
form similarly to what you've done in your function.

 

Derrell

 

 

postToUrl : function(url, params, newWindow)

                        {

                                               var form =
document.createElement('form');

                                               form.action = url;

                                               form.method = 'POST';

                                               if(newWindow){ form.target =
'_blank'; }

 

                                               for (var i in params) 

                                               {

                                                                       if
(params.hasOwnProperty(i)) {

 
var input = document.createElement('input');

 
input.type = 'hidden';

 
input.name = i;

 
input.value = params[i];

 
form.appendChild(input);

                                                                       }

                                               }

 

                                               // Submit the form, then
remove it from the page

 
document.body.appendChild(form);

                                               form.submit();

                        },

 

 


 


SAKsystems

Inh. Mustafa Sak

Varrelmannstr. 16

30453 Hannover

Tel.   +49 511 / 165 969 40 <tel:%2B49%20511%20%2F%20165%20969%2040> 

Fax   +49 511 / 165 969 49 <tel:%2B49%20511%20%2F%20165%20969%2049> 

Mobil +49 163 / 312 6144 <tel:%2B49%20163%20%2F%20312%206144> 

http://www.saksys.de

 <mailto:[email protected]> [email protected]

STEUER-Nr. 2613817458

 


----------------------------------------------------------------------------
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

 

<<attachment: Mustafa Sak ([email protected]).vcf>>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to