Hello!

On 3/23/06, Thomas Oeding <[EMAIL PROTECTED]> wrote:
> Hello Björn,
> the extra Params works now, but which qooxdoo version i need?
> version 0.5.1 does simply nothing (with following debug-log)

I dont know. I have only tested it with my CVS checkout from 20060228,
but there it seemed to work fine on all Gecko browsers I tested with.
I do get the error NS_ERROR_DOM_SECURITY_ERR. But I have always
assumed that some other part of qooxdoo was responsible for that
because the error doesn't seem to break anything.

> > QxButton[HASHCODE:80]
> > 313439:Failed to execute "_dispatchEvent()":Could not dispatch event of
> > type "execute":Das Objekt unterstützt diese Eigenschaft oder Methode
> > nicht.

I'm not good at German, but that error suggests to me that something
has changed in the API between the version I have and svn trunk. It
sounds like the "execute" signal of QxButton has been removed?

> the request reaches the server:
>
> > _POST["owner_id"] 32
> > _POST["comment"] Nice file
> > _POST["upload"] no value
> >
> but the upload field has no value

Which browser is this? I'm pasting the full example again so you can
see how it is supposed to look. Hope that helps.

*****************************************************************************
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="de">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
  <title>Transport 7 @ qooxdoo :: demo</title>
  <link type="text/css" rel="stylesheet" href="../demolayout.css"/>
  <script type="text/javascript" src="../../script/qooxdoo.js"></script>
</head>
<body>
  <script type="text/javascript" src="../demolayout.js"></script>

  <div id="demoDescription">
    <p>Demonstrates how you can use a QxTextField and a
    QxIframeTransport to upload files</p>
  </div>

  <script type="text/javascript">

  function QxUploadField(name)
  {
    QxTextField.call(this);
    this.setHtmlProperty("type", "file");
    this.setHtmlProperty("name", name || "upload");
  }
  QxUploadField.extend(QxTextField, "QxUploadField");

  function QxFileTransport()
  {
    QxIframeTransport.call(this);
    this.setMethod("POST");
    this._form.enctype = "multipart/form-data";
  };
  QxFileTransport.extend(QxIframeTransport, "QxFileTransport");

  QxFileTransport.prototype.setUploadWidget = function(widget, params)
  {
    var el = widget.getElement();
    this._form.appendChild(el.cloneNode(true));
    for (var attr in params)
    {
      var input = document.createElement("input");
      input.name = attr;
      input.type = "text";
      input.value = params[attr];
      this._form.appendChild(input);
    }
  };

  window.application.main = function()
  {
    var d = this.getClientWindow().getClientDocument();

    var lay = new QxVerticalBoxLayout;
    lay.setLocation(20, 48);
    lay.setRight(335);
    lay.setBottom(48);
    this.add(lay);

    var fsq = new QxFieldSet("Request");
    fsq.setHeight("auto");
    lay.add(fsq);

    var hlay = new QxHorizontalBoxLayout;
    hlay.setVerticalChildrenAlign("middle");
    hlay.setSpacing(4);
    hlay.auto();
    fsq.add(hlay);

    upload = new QxUploadField();

    hlay.add(upload);

    button = new QxButton("Upload!");

    // Layouting doesn't seem to work with input type="upload"
    button.setLeft(110);
    hlay.add(button);

    button.addEventListener("execute", function(e) {
      var transport = new QxFileTransport();

      // You need to have a webserver running with a page named
      // "upload" to actually upload the file.
      transport.setUrl("http://localhost:8080/upload";);
      transport.setUploadWidget(upload, {owner_id: 32,
                                         comment: "Nice file!"});
      transport.addEventListener("completed", function(e) {
        alert("File " + upload.getValue() + " was uploaded!");
      });
      transport.send();
    });
  }

  </script>
</body>
</html>
*****************************************************************************
--
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