Well, I figured out how to customize a List component so it will allow you to both Drag and Drop objects between its items and also into its items. Check it out:
For some reason the 'View Source' does not work within Blogspot - go figure. View the source here.
Here is a link to the source if you are interested.
InsertableDropList.zip
Cheers
Friday, September 21, 2007
Flex Lists and Dragging - Replace instead of Move?
To save time on one of our recent projects, we decided to switch away from a tree data view to a list data view. Basically, we have a list on the left with the root objects and when you select one it loads in its children via WebORB and .NET into the list on the right.
Now, one of our specifications was to allow the dragging of a child item into a different parent. "Oh, simple!" we thought, "You just drag the child item from the list on the right into a new parent on the left." Not really.
Nobody considered the fact that lists only allow you to drop an item *between* two of its list elements, and not *into* one of its elements. This is for obvious reasons - normally you would not want to do this.
Now, I can handle the dragDrop event and rather than add the child item to the List, place it as a child into the new parent. Unfortunately, though, I can't figure out how to control the annoying little line that appears *between* list items on a dragOver. I did some hunting and thought, "wow, I can just override the ListBase dragOverHandler." Nope, the dragOverHandler does not allow an override. All I want is to completely highlight the item I am moving over to indicate that you will be moving the child into the parent.
Any ideas?
Now, one of our specifications was to allow the dragging of a child item into a different parent. "Oh, simple!" we thought, "You just drag the child item from the list on the right into a new parent on the left." Not really.
Nobody considered the fact that lists only allow you to drop an item *between* two of its list elements, and not *into* one of its elements. This is for obvious reasons - normally you would not want to do this.
Now, I can handle the dragDrop event and rather than add the child item to the List, place it as a child into the new parent. Unfortunately, though, I can't figure out how to control the annoying little line that appears *between* list items on a dragOver. I did some hunting and thought, "wow, I can just override the ListBase dragOverHandler." Nope, the dragOverHandler does not allow an override. All I want is to completely highlight the item I am moving over to indicate that you will be moving the child into the parent.
Any ideas?
Saturday, September 15, 2007
Flex and Java - a simple example server and client
The other day I discovered that Flex has the ability to open up a custom socket, allowing all sorts of cool possibilities (i.e. multiplayer games).
So I sat down to code a little Java server and Flex client that could talk to eachother. What evolved was a super simple (and rather useless) little chat app. Its anonymous, only works on one computer, but - what the heck - I learned something.
Now, here it is, in all its splendor. You should be able to view the readme.txt file in the root directory and get all you need there to start it up.
flex2java.zip (4 mb, big because its using Java Service Wrapper)
Enjoy!
So I sat down to code a little Java server and Flex client that could talk to eachother. What evolved was a super simple (and rather useless) little chat app. Its anonymous, only works on one computer, but - what the heck - I learned something.
Now, here it is, in all its splendor. You should be able to view the readme.txt file in the root directory and get all you need there to start it up.
flex2java.zip (4 mb, big because its using Java Service Wrapper)
Enjoy!
Subscribe to:
Posts (Atom)