[Windmill-dev] Drag and Drop

adam at osafoundation.org adam at osafoundation.org
Thu Mar 13 13:59:58 PDT 2008


Vern,

First off it is great to hear that you have been checking out Windmill! I
could probably give you a more specific solution if you explained your
requirements in a bit more detail. Drag + Drop turns out to be a bit more
complicated feature than the recordable windmill actions, and I admit does
need more attention to stream line it.

The solution that we came up with for our super ajaxy drag and dropy app
was to create a 'windmill extension'
http://windmill.osafoundation.org/trac/wiki/BookChapter-7-Extensions

Since there can be a lot of factors involved in making drag drop work
'correctly' depending on offsets etc in an application it's most likely
that you will want to be able to monkey around with this function, or have
variations of the function depending on what is going on in your app.

An example of our function is the cosmoDragDrop function:
http://windmill.osafoundation.org/trac/browser/windmill/trunk/windmill/html/js/extensions/extensions.js?rev=570

A much more generic dragDrop function is built in to the controller, and
you can see what it does in this file:

http://windmill.osafoundation.org/trac/browser/windmill/trunk/windmill/html/js/controller/controller.js

to use cosmoDragDrop we would make the windmill call like:

{"method": "extensions.cosmoDragDrop", "params": {"dragged" : {"jsid":
"windmill.testWindow.cosmo.view.cal.canvasInstance.getSelectedItemId()",
"pfx": "eventDivContent__"}, "destination": {"id": "hourDiv0-900"}}}

Which would have the Python test equivalent of:

client.extensions.cosmoDrapDrop(dragged={"id":
"myElementToDrag", "pfx": ""}, destination={"id": "destinationDivId"}}})

We had a dynamic prefix thus the "pfx", but you probably won't need that.

The short of it is that to get the results you are looking for you may
need to do a bit of JavaScript hacking, but if you come hangout in
#windmill on freenode I can certainly help you -- and maybe even
streamline this a little bit.

Thanks again -- I hope this helps somewhat.

Adam

> Hi,
>
> I am evaulating Windmill for testing an ajax application we are
> developing. Drag and drop is used extensively in our application. How do I
> create a drag and drop test? Are there any examples I can use. I prefer to
> use Python.
>
> Other than the drag and drop issue, Windmill looks great!
>
> Best Regards, Vern Muhr
> _______________________________________________
> Windmill-dev mailing list
> Windmill-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/windmill-dev
>



More information about the Windmill-dev mailing list