> >> Currently qooxdoo doesn't feature any special form handling. You must do
> >> it your own. But I think it's a bad idea to directly use
> >> QxIframeTransport. Better is to try to integrate this using the real
> >> transport API and handle it somewhere in QxRequest.
> >
> > It is not so easy because, as you probably already know, inputs of
> > type "file" has to be handled specially. You need to have a form that
> > you submit() and that form needs to contain the file input and the
> > file input need to have been attached to the document.
> > QxIframeTransport is the only suitable class I have found because it
> > has a private _form attribute to which the file input can be appended.
>
> Using myRequest.setCrossDomain(true) for example switch to the iframe
> transport because xmlhttp couldn't handle this type of request. I think,
> if you would really like to help in this area, you have no other choice
> than reading and understanding the already existing implementation in
> the transport folder. I'm happy to answer you all questions you have
> regarding this area.

Thanks! My first question is how to get QxIframeTransport to handle
POST requests. It seems to be that the QxRequest's method property is
more or less ignored by the QxIframeTransport's send() method. The
parameters are not POST:ed, but instead they are appended to the URL
like in GET requests. This obviously doesn't work for file uploads
because the file parameter has to be posted.

I think the way to solve that would be to have the send method check
if method is POST and if so add all parameters to the _form. Something
like:

for (vId in vParameters) {
    var input = document.createElement("input");
    input.type = "text";
    input.value = vParameters[vId];
    input.name = vId;
}

Secondly, how is the file supposed to get into the request?
setParameter doesn't work for reasons I have explained. And last, the
enctype of the _form needs to be changed to "multipart/form-data." How
am I supposed to do that? There is no API for it. Maybe an additional
method on QxRequest, setFileUploadElement(), would do and then let
that do all the necessary adjustments like setCrossDomain() does? It
seems dirt simple, but only if you are allowed to change the API of
the QxRequest. :)

--
mvh Björn


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to