Monday, July 9, 2007

Frustrating Flex problems solved #1 - dropEnabled

I set up a drag-drop interaction between two components - from a custom 'dragMe' component i set up(extending Canvas) to a Tree component, but couldn't work out why my Tree wouldn't allow dragMe to drag over it. Until I started experimenting with removing properties from the Tree component. Eventually(this sort of trial and error can be soo slow going in flex) I found the source of the problem: i had dropEnabled set to true. huh? how unintuitive is that?!! as soon as i set dropEnabled to false(or left it out altogether because that's the default) the behaviour works fine.

After reading up on this property it does make sense - dropEnabled refers purely to the default drop behaviour. really defaultDropEnabled would be a more intuitively named property, but anyway i put this information out there for others not to waste the time i did yesterday!

No comments: