Just a guess, but one possibility is that your list's default drop
behaviour is switched on, i.e. on the list control, dropEnabled="true".
This could cause the item to be added twice, once by your event handler
and once by the default drop behaviour.

Paul

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of flexabledev
Sent: Saturday, April 22, 2006 9:38 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Drag & Drop conundrum...

I've started to experiment with Drag & Drop and have run into a
problem I can't figure out.  I have successfully written code that
allows me to Drag rows from a DataGrid (with a custom Drag Proxy) and
Drop the value of one of the columns into a List.  The only thing I
don't understand is why when I do a Drag & Drop, I always get two
entries in the List for each of the rows that were dragged.  If I drag
two rows with String values that get dropped (i.e. "ONE", "TWO"), the
result in the List after the Drop looks like:

[object Object]
[object Object]
ONE
TWO

When I debug it, the value of items.length equals 2

which drives a For loop with
    IList(dropTarget.dataProvider).addItem(items[i].field);

As I step through the doDragDrop function in debug mode, it only
executes the loop twice, yet I end up with four entries in the List?

Any ideas? 

I can't figure it out, but it feels like there is some default
behaviour (dropping the "items" Object separate from my "addItem")
occuring that I don't see when I step through it in debug mode?






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to