Skip navigation
Currently Being Moderated

Flex Drag And drop

Mar 2, 2013 5:45 PM

Tags: #drop #flex #drag #alert #events

Hello All,

 

I'm having problems suspending a drag and drop operation based on User input from an Alert prompt. i have a flex tree that acts as a drag initiator and a drop target as well (Dragging items of the tree within the tree itself) I'm trying to do a drag and then fire an alert prompt asking the user something like "Are you sure you want to move this item? Yes or No" when the item is dropped to a different location in the tree.

 

My first problem was that, the item is moved regardless of the outcome of the user's choice and i had to do an event.preventDefault() on the Drag drop handler to stop this from happening, After which i put my own custum logic saving the drag event  to a variable to later redispatch it to complete the DnD process (Which seems rational).

 

My question is, Am I suspending the right type of event? How do i get something as simple as this working. After a while i started receiving this error "Error: Attempt to access a dead clipboard", is this a bug with the flex framework.

 

Any form of help will be very much appreciated, i also googled, stackoverflowed, and looked through every flex cookbook i know but no solution.

 

Please help me

 
Replies
  • Currently Being Moderated
    Mar 2, 2013 9:30 PM   in reply to l33tian

    I’m pretty sure Flex Drag and Drop is not designed for this scenario.  I seem to recall other people struggling to do it  in the past.

     

    IIRC one problem is that there is an effect played to show the drop worked and suspending to ask a question causes that effect to play too soon, or not play at all.  I think some folks wait for dragComplete if they know how to undo the drop, but the Alert shows on top of the tree with the object already dropped.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points