BJörn Lindqvist schrieb:
After some work, I finally figured out a way to do it. There seem to
be others that have had the same question as me, so maybe this is
useful to someone. It is a little hackish because I couldn't find a
way to get input-tags with type "file" to layout correctly. If someone
knows a better way to upload files please tell me. Also I haven't
tested the method in any other browser than Firefox and Galeon but in
those it seem to work. Also qooxdoo doesn't have a form element so
it's not obvious how one should do it because you need a form element.

You need two parts, a QxTextField with type set to "file" and a
QxIframeTransport. When you want to upload the file you must clone the
input-tag in the QxTextField widget and attach it to
QxIframeTransport's _form element. Then you set the _form's enctype to
"multipart/form-data" and call setMethod("POST") on the
QxIframeTransport and submit the form. You can also add an handler
with addEventHandler to QxIframeTransport to know when the upload has
completed.

Good idea, but QxIframeTransport was never thought to be used directly. This is part of the new transport implementation. You can take a look at these "Transport_*.html" demos files.

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.

Sebastian



I have attached an example of it, which maybe can be added to qooxdoo?

--
mvh Björn


------------------------------------------------------------------------

Simple test for qooxdoo's transport implementation using some data for an addressbook.

Using javascript/json content in this case.




-------------------------------------------------------
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&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to