Hi wgw,

that's crazy, the problem is the alert message box, remove it and you will see that the error is gone.

It seems to me that the alert execution change something so that the getData call think he is not in a drop event.

Cheers,
Chris

Am 07.05.2010 18:35, schrieb wgw:
I'm learning qx 1.1 by combining the drag-drop list demo with the tree demo so that I will have a drag-drop tree demo. I want to be able to construct one tree (as is in the tree demo) and then drag items from that tree to another tree (as in the list demo).

Everything seems to work fine until the drop point, where I get an error:

Error: This method must not be used outside the drop event listener!
Source File: file:///home/bill/Soft/hack/Python/qooxdoo-1.0.1-sdk/framework/source/class/qx/event/handler/DragDrop.js
Line: 204

The problem is the the getData method. Yet I don't see how that error message applies in my case, because the only place I use getData is in an event listener. Here is my listener for the target tree:

tree2.addListener("drop", function(e) {
        alert(e.getRelatedTarget());
        var items = e.getData("qx/tree-items"); //this is a problem???
        for (var i=0, l=items.length; i<l; i++) {
            this.add(items[i]);
        };
});

I have no idea why I am getting an error here, though I suspect I am using misusing "this" or there is an event bubble effect that I have not been able to follow.

Any pointers on how to solve this? The full code is attached (Application.js <http://n2.nabble.com/file/n5020171/Application.js>).

Thanks!
------------------------------------------------------------------------
View this message in context: getData error (blind newb question) <http://qooxdoo.678.n2.nabble.com/getData-error-blind-newb-question-tp5020171p5020171.html> Sent from the qooxdoo mailing list archive <http://qooxdoo.678.n2.nabble.com/> at Nabble.com.


--
Christian Hagendorn
Software Entwickler

1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe

Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas 
Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver 
Mauss, Gert Nowotny, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren

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

_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to