[EMAIL PROTECTED] writes:

> Typically, you don't manually set the transport to be used; instead, you
> specify how you'll be using it (async vs sync; cross-domain vs same domain)
> and the correct transport is determined.  I don't recall, however, where that
> determination is made.

So a bit of further looking reveals that it's not just "typically" done that
way, it seems it's exclusively done that way.  It also appears that there is
no way in the current code to have IframeTransport be used.

The attached entirely-untested patch should allow you to specify to use
IframeTransport by calling the following two methods:

  req.setAsynchronous(true);
  req.setFileUpload(true)

IframeTransport only supports asynchronous requests, thus the first line is
required if it is to be selected.  No other transport supports file upload, so
if async and fileUpload are both selected, IframeTransport will be used.

>>>>>> I've subclassed qx.io.remote.IframeTransport and want to tell the remote
>>>>>> request object to use this transport.
>>>>>>
>>>>>> How can this be done?

Now you're getting into "internals"; this ability is not quite exposed to the
user.  What it appears you'll have to do is modify
qx.io.remote.RemoteExchange.typesOrder to insert your subclass before
IframeTransport.  The value of qx.io.remote.RemoteExchange.typesOrder is:

  qx.io.remote.RemoteExchange.typesOrder =
  [
    "qx.io.remote.XmlHttpTransport",
    "qx.io.remote.IframeTransport",
    "qx.io.remote.ScriptTransport"
  ];

so you'll likely want to modify it something like this:

  qx.io.remote.RemoteExchange.typesOrder =
  [
    "qx.io.remote.XmlHttpTransport",
    "mySubclassOfIframeTransport",
    "qx.io.remote.ScriptTransport"
  ];

If you plan to be playing with this, you should be studying RemoteRequest and
RemoteExchange to see how they work.

Good luck. :-)

Derrell

Index: frontend/framework/source/class/qx/io/remote/RemoteRequest.js
===================================================================
--- frontend/framework/source/class/qx/io/remote/RemoteRequest.js	(revision 4695)
+++ frontend/framework/source/class/qx/io/remote/RemoteRequest.js	(working copy)
@@ -154,6 +154,15 @@
 */
 qx.OO.addProperty({ name : "crossDomain", type : qx.constant.Type.BOOLEAN, defaultValue : false });
 /*!
+  Indicate that the request is will be used for a file upload.
+
+  The request will be used for a file upload.  This switches the concrete
+  implementation that is used for sending the request from
+  qx.io.remote.XmlHttpTransport to qx.io.remote.IFrameTransport, because only
+  the latter can handle file uploads.
+*/
+qx.OO.addProperty({ name : "fileUpload", type : qx.constant.Type.BOOLEAN, defaultValue : false });
+/*!
   The transport instance used for the request.
 
   This is necessary to be able to abort an asynchronous request.
Index: frontend/framework/source/class/qx/io/remote/RemoteExchange.js
===================================================================
--- frontend/framework/source/class/qx/io/remote/RemoteExchange.js	(revision 4695)
+++ frontend/framework/source/class/qx/io/remote/RemoteExchange.js	(working copy)
@@ -411,6 +411,10 @@
     vNeeds.crossDomain = true;
   }
 
+  if (vRequest.getFileUpload()) {
+    vNeeds.fileUpload = true;
+  }
+
   var vTransportImpl, vTransport;
   for (var i=0, l=vUsage.length; i<l; i++)
   {
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to