[flexcoders] Drag and Drop question
Hello, How to Drag an Image A on the Image B. The image A replace the image B. And the image B come to replace the image A automatically. (There is a swapping). I use DragDropHandler and dragEnterHandler. Thank you, Christophe,
[flexcoders] Drag and Drop toolbox
Well, in the toolbox the are labels for the components.I want to drag the label and drop the component.After that i want to double click the component to show an alert. The Application: ?xml version=1.0 encoding=utf-8? s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx minWidth=955 minHeight=600 xmlns:components=components.* fx:Declarations s:ArrayList id=tool s:Label name=label/ s:TextInput name=textInput/ s:BorderContainer name=Region/ /s:ArrayList /fx:Declarations fx:Script ![CDATA[ import mx.controls.Alert; import mx.core.IUIComponent; import mx.events.DragEvent; import mx.managers.DragManager; import spark.components.BorderContainer; import spark.components.Group; protected function dragEnterHandler(event:DragEvent):void { DragManager.acceptDragDrop(event.currentTarget as IUIComponent); } protected function dragDropHandler(event:DragEvent):void { event.dragInitiator.x = event.currentTarget.mouseX - event.dragInitiator.width/2; event.dragInitiator.y = event.currentTarget.mouseY - event.dragInitiator.height/2; event.currentTarget.addElement(event.dragInitiator as IUIComponent); } protected function tool1_dragCompleteHandler(event:DragEvent):void { event.dragInitiator.addEventListener(MouseEvent.DOUBLE_CLICK, goa); } public function goa(event:MouseEvent):void { Alert.show(ok); } ]] /fx:Script components:Body x=106 width=955 height=400 dragEnter=dragEnterHandler(event) dragDrop=dragDropHandler(event) y=0 doubleClickEnabled=true mouseEnabled=true/ components:Tool x=800 y=400 dataProvider={tool} dragComplete=tool1_dragCompleteHandler(event) / /s:Application and the Tool component: ?xml version=1.0 encoding=utf-8? s:SkinnableDataContainer xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx width=100 height=100 s:layout s:VerticalLayout/ /s:layout fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations fx:Script ![CDATA[ import flash.utils.flash_proxy; import mx.core.DragSource; import mx.core.IUIComponent; import mx.managers.DragManager; import mx.utils.object_proxy; import spark.components.Label; import spark.components.supportClasses.ItemRenderer; public function mouseDownHandler(event:MouseEvent):void { // var dragSrc:Object = event.currentTarget ; // var className:String = getQualifiedClassName(dragSrc); //var klass:Class = getDefinitionByName(className) as Class; //var proxy:* = new klass(); DragManager.doDrag(event.currentTarget as IUIComponent,null,event); } ]] /fx:Script s:itemRenderer fx:Component s:ItemRenderer s:HGroup s:Label text={data} mouseDown=outerDocument.mouseDownHandler(event)/ /s:HGroup /s:ItemRenderer /fx:Component /s:itemRenderer /s:SkinnableDataContainer It drops only the labels and the double click doesn't work. any ideas? Thank You
Re: [flexcoders] Drag and drop vs scrolling
Some folks have tried making the renderer a drop target in order to add different meaning to dropping in folders. In theory it should work, but I think I’d work from the Tree instead, and then I would expect autoscroll to work. On 4/20/10 3:31 PM, Richard Rodseth rrods...@gmail.com wrote: I inherited some code which supports drag and drop from a list to a node of a tree. Unfortunately it does not work when the tree is scrolled. Not only does the tree not autoscroll, but even if you scroll the target item into view before beginning the drag, incorrect nodes highlight. I didn't see any code that's doing coordinate transformations, but did notice that there is a custom TreeItemRenderer, which contains the listeners for dragEnter etc. I'm guessing this is the root of the problem, since renderers are recycled. I've no idea why things were done this way, and am wondering if this is a legitimate idiom, or if I need to start over with listeners defined at the Tree level. Also, is autoscroll supported if you do things the right way? -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Drag and drop vs scrolling
Thanks. I was able to fix the highlighting issue by modifying some code that used listData.rowIndex to use calculateDropIndex() instead. Autoscroll doesn't work, but I can live with that. On Tue, Apr 20, 2010 at 11:41 PM, Alex Harui aha...@adobe.com wrote: Some folks have tried making the renderer a drop target in order to add different meaning to dropping in folders. In theory it should work, but I think I’d work from the Tree instead, and then I would expect autoscroll to work. On 4/20/10 3:31 PM, Richard Rodseth rrods...@gmail.com wrote: I inherited some code which supports drag and drop from a list to a node of a tree. Unfortunately it does not work when the tree is scrolled. Not only does the tree not autoscroll, but even if you scroll the target item into view before beginning the drag, incorrect nodes highlight. I didn't see any code that's doing coordinate transformations, but did notice that there is a custom TreeItemRenderer, which contains the listeners for dragEnter etc. I'm guessing this is the root of the problem, since renderers are recycled. I've no idea why things were done this way, and am wondering if this is a legitimate idiom, or if I need to start over with listeners defined at the Tree level. Also, is autoscroll supported if you do things the right way? -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Drag and drop vs scrolling
I inherited some code which supports drag and drop from a list to a node of a tree. Unfortunately it does not work when the tree is scrolled. Not only does the tree not autoscroll, but even if you scroll the target item into view before beginning the drag, incorrect nodes highlight. I didn't see any code that's doing coordinate transformations, but did notice that there is a custom TreeItemRenderer, which contains the listeners for dragEnter etc. I'm guessing this is the root of the problem, since renderers are recycled. I've no idea why things were done this way, and am wondering if this is a legitimate idiom, or if I need to start over with listeners defined at the Tree level. Also, is autoscroll supported if you do things the right way?
[flexcoders] drag and drop panel from one tab to another tab.
Hi All, Can we drag and drop panel from one tab to another. look at the below dashboard link: http://examples.adobe.com/flex3/devnet/dashboard/main.html i want to drag one of panel from sales to marketing. how can v achieve this? i tried lots of way, but unsuccessful. can anyone share his/her suggestion. Regards, Krunal Panchal
[flexcoders] Drag and drop, custom cursor during drag not working
I have a datagrid that I want the user to sort the rows on. To make it obvious that it's sortable I am implementing some custom cursors. But I'm having a problem when I actually drag an item. Can anyone help me out? Thanks here's a psuedo demonstration of the problem Application = normal cursor // fine Rollover datagrid = open hand cursor // good so far mousedown on datagrid = closed hand cursor // good dragging item around = closed hand cursor // switches back to normal cursor (if I move it around real fast I can see my custom curser for an instant) mouse up on datadrid = open hand cursor // not sure, after I drop it goes back to open hand but if I mouse down, dont move and mouse up I have a closed hand rollout of datagrid = normal cursor //good datagrid code: mx:DataGrid id=sectQuestionsDG x=10 y=204 width=558 height=277 headerHeight=0 selectable={editMode} dragMoveEnabled={editMode} dragEnabled={editMode} dropEnabled={editMode} dragDrop=sectQuestReOrder(event); rollOver=over(); mouseDown=down(); mouseUp=up(); rollOut=out();/ functions: public function over():void{ CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0); } public function down():void{ CursorManager.setCursor(grabbingCursor,CursorManagerPriority.HIGH,0,0); } public function up():void{ CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0); } public function out():void{ CursorManager.removeAllCursors(); }
Re: [flexcoders] Drag and drop, custom cursor during drag not working
Just a thought, as I haven't tried the method you described. What about setting the styles of the cursor on mouse down? var styleSheet:CSSStyleDeclaration = StyleManager.getStyleDeclaration(DragManager); styleSheet.setStyle(moveCursor, grabCursor); or styleSheet.setStyle(copyCursor, grabCursor); And you could set it back on mouse up. Just a thought because maybe DragManager is setting things back to what it has set in its styles. On Thu, Dec 17, 2009 at 8:19 AM, invertedspear invertedsp...@yahoo.comwrote: I have a datagrid that I want the user to sort the rows on. To make it obvious that it's sortable I am implementing some custom cursors. But I'm having a problem when I actually drag an item. Can anyone help me out? Thanks here's a psuedo demonstration of the problem Application = normal cursor // fine Rollover datagrid = open hand cursor // good so far mousedown on datagrid = closed hand cursor // good dragging item around = closed hand cursor // switches back to normal cursor (if I move it around real fast I can see my custom curser for an instant) mouse up on datadrid = open hand cursor // not sure, after I drop it goes back to open hand but if I mouse down, dont move and mouse up I have a closed hand rollout of datagrid = normal cursor //good datagrid code: mx:DataGrid id=sectQuestionsDG x=10 y=204 width=558 height=277 headerHeight=0 selectable={editMode} dragMoveEnabled={editMode} dragEnabled={editMode} dropEnabled={editMode} dragDrop=sectQuestReOrder(event); rollOver=over(); mouseDown=down(); mouseUp=up(); rollOut=out();/ functions: public function over():void{ CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0); } public function down():void{ CursorManager.setCursor(grabbingCursor,CursorManagerPriority.HIGH,0,0); } public function up():void{ CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0); } public function out():void{ CursorManager.removeAllCursors(); }
[flexcoders] Drag and drop into Advanced Datagrid
I was wondering if there are any examples of Drag and Drop into an advanced datagrid with an array collection as the data provider? Thanks for the help. timgerr
[flexcoders] Drag and Drop to DataGrid errors
I found the code at the end of this post while trying to learn about drag and drop to an Air app. It looks like it should do what I want, but generates two errors that I have been unable to solve (I am still very much a newbie). the errors are: [SWF] DragDrop.swf - 1,284,532 bytes after decompressionError #2044: Unhandled IOErrorEvent:. (2044 Unhandled %1:.) text=Error #2038: File I/O Error. (2038 File I/O Error.) at flash.desktop::Clipboard/getFileList() at anonymous() at flash.desktop::Clipboard/convertNativeFormat() at flash.desktop::Clipboard/getData() at DragDrop/onDrop()[D:\tex\My Documents\Flex_Builder_3_Projects\DnD\OriginalDragAndDrop\src\DragDrop.m\ xml:41] The error seems to be pointing to the private onDrop function. Can anyone offer any suggestions? many thanks in advance, Tex source code: ?xml version=1.0 encoding=utf-8?mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical width=400 height=300 creationComplete=onStartup(event); mx:Script![CDATA[ import flash.desktop.*;import flash.filesystem.*;import mx.utils.ArrayUtil;//newimport mx.collections.ArrayCollection; //new private var _files:Array = []; [Bindable] //newprivate var arrayCollection:ArrayCollection;//new private function onStartup(event:Event): void { arrayCollection = new ArrayCollection(); //new addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, onDragIn); addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, onDrop);} private function onDragIn(event:NativeDragEvent):void { if(event.clipboard.hasFormat(ClipboardFormats.FILE_LIST_FORMAT)) { var files:Array = event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array; if( files.length 0 ) NativeDragManager.acceptDragDrop(this); }} //error points to this functionprivate function onDrop(event:NativeDragEvent) : void { for each ( var f:File in event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array ) arrayCollection.addItem({name:f.name, size:f.size, object:f});//new _files.push(f); uploadNextFile();} private function uploadNextFile(event:Event=null) : void { if ( _files.length 0 ) { var f1:File = _files.pop() as File; f1.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,uploadNextFile); f1.upload( new URLRequest( 'http://localhost/Upload.php' ), 'Filedata' ); } dgFileList.dataProvider = _files;} ]]/mx:Script mx:DataGrid id=dgFileList width=100% height=100% mx:columns mx:DataGridColumn headerText=File Name dataField=name width=100/ mx:DataGridColumn headerText=Size dataField=size width=30/ mx:DataGridColumn headerText=Progress dataField=object width=150 mx:itemRenderermx:Component mx:HBox verticalAlign=middle mx:ProgressBar id=ProgBar label= height=6 source={data.object}/ /mx:HBox /mx:Component /mx:itemRenderer /mx:DataGridColumn /mx:columns /mx:DataGrid /mx:WindowedApplication
[flexcoders] Drag and drop
Hi all, Am new to flex. Was learning with examples given in flex3 livedoc. http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_1.html There i came across this drag and drop example. mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ //Import classes so you don't have to use full names. import mx.managers.DragManager; import mx.core.DragSource; import mx.events.DragEvent; import flash.events.MouseEvent; // Embed icon image. [Embed(source='assets/globe.jpg')] public var globeImage:Class; // The mouseMove event handler for the Image control // initiates the drag-and-drop operation. private function mouseMoveHandler(event:MouseEvent):void { var dragInitiator:Image=Image(event.currentTarget); var ds:DragSource = new DragSource(); ds.addData(dragInitiator, img); DragManager.doDrag(dragInitiator, ds, event); } // The dragEnter event handler for the Canvas container // enables dropping. private function dragEnterHandler(event:DragEvent):void { if (event.dragSource.hasFormat(img)) { DragManager.acceptDragDrop(Canvas(event.currentTarget)); } } // The dragDrop event handler for the Canvas container // sets the Image control's position by // dropping it in its new location. private function dragDropHandler(event:DragEvent):void { Image(event.dragInitiator).x = Canvas(event.currentTarget).mouseX; Image(event.dragInitiator).y = Canvas(event.currentTarget).mouseY; } ]] /mx:Script !-- The Canvas is the drag target -- mx:Canvas id=v1 width=500 height=500 borderStyle=solid backgroundColor=#DD dragEnter=dragEnterHandler(event); dragDrop=dragDropHandler(event); !-- The image is the drag initiator. -- mx:Image id=myimg source=@Embed(source='assets/globe.jpg') mouseMove=mouseMoveHandler(event);/ /mx:Canvas /mx:Application here to set drag initiator , Canvas(event.currentTarget).mouseX; this x will be the x during mouse button release . Instead , I want the x and y of the shadow of the image (ie the border of the image). How will i set it? Please help. -- View this message in context: http://www.nabble.com/Drag-and-drop-tp24567297p24567297.html Sent from the FlexCoders mailing list archive at Nabble.com.
Re: [flexcoders] Drag and drop
you can do this with a trick: when you start drag remember the mouseX and mouseY. code list this: // The mouseMove event handler for the Image control // initiates the drag-and-drop operation. private function mouseMoveHandler(event: MouseEvent):void { var dragInitiator:Image=Image(event.currentTarget); var ds:DragSource = new DragSource(); ds.addData(dragInitiator, img); var point:Point=new Point(dragInitiator.mouseX,dragInitiator.mouseY); ds.addData(point, mouseOffset); DragManager.doDrag(dragInitiator, ds, event); } and when you drop this target, minus mouseOffset. code like this:// The dragDrop event handler for the Canvas container // sets the Image control's position by // dropping it in its new location. private function dragDropHandler(event:DragEvent):void { var ds:DragSource=event.dragSource; var p:Point=ds.dataForFormat(mouseOffset) as Point; Image(event.dragInitiator).x =Canvas(event.currentTarget).mouseX - p.x; Image(event.dragInitiator).y =Canvas(event.currentTarget).mouseY - p.y; } On Mon, Jul 20, 2009 at 6:28 PM, kk4Nabble kavya@gmail.com wrote: Hi all, Am new to flex. Was learning with examples given in flex3 livedoc. http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_1.html There i came across this drag and drop example. mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ //Import classes so you don't have to use full names. import mx.managers.DragManager; import mx.core.DragSource; import mx.events.DragEvent; import flash.events.MouseEvent; // Embed icon image. [Embed(source='assets/globe.jpg')] public var globeImage:Class; // The mouseMove event handler for the Image control // initiates the drag-and-drop operation. private function mouseMoveHandler(event:MouseEvent):void { var dragInitiator:Image=Image(event.currentTarget); var ds:DragSource = new DragSource(); ds.addData(dragInitiator, img); DragManager.doDrag(dragInitiator, ds, event); } and // The dragEnter event handler for the Canvas container // enables dropping. private function dragEnterHandler(event:DragEvent):void { if (event.dragSource.hasFormat(img)) { DragManager.acceptDragDrop(Canvas(event.currentTarget)); } } // The dragDrop event handler for the Canvas container // sets the Image control's position by // dropping it in its new location. private function dragDropHandler(event:DragEvent):void { Image(event.dragInitiator).x = Canvas(event.currentTarget).mouseX; Image(event.dragInitiator).y = Canvas(event.currentTarget).mouseY; } ]] /mx:Script !-- The Canvas is the drag target -- mx:Canvas id=v1 width=500 height=500 borderStyle=solid backgroundColor=#DD dragEnter=dragEnterHandler(event); dragDrop=dragDropHandler(event); !-- The image is the drag initiator. -- mx:Image id=myimg source=@Embed(source='assets/globe.jpg') mouseMove=mouseMoveHandler(event);/ /mx:Canvas /mx:Application here to set drag initiator , Canvas(event.currentTarget).mouseX; this x will be the x during mouse button release . Instead , I want the x and y of the shadow of the image (ie the border of the image). How will i set it? Please help. -- View this message in context: http://www.nabble.com/Drag-and-drop-tp24567297p24567297.html Sent from the FlexCoders mailing list archive at Nabble.com. -- Dingpeng Cao Email: caodingp...@gmail.com
[flexcoders] Drag n Drop from desktop to Flex application
Hi Flex Coders, I have a file placed on the desktop. I have to drag n drop it on the flex application and recognize the file name path in the flex application. I also have to upload a file to the server by dragging it form the desktop and dropping it on the flex application. Is this possible in Flex? if yes, please guide me. Thanks in anticipation. Avi
[flexcoders] Drag n Drop from one Flex application to another Flex application.
Hi, I have two flex applications and I want to drag n drop display objects for one application to another application. Is this possible? if yes please provide some pointers. Thanks, Avi
Re: [flexcoders] Drag n Drop from one Flex application to another Flex application.
I guess it is not possible, because between the two applications you should have access to the system drag and drop manager. By the way, you can do it in an air application. (by the way, hi everyone, i'm new :) 2009/7/13 avibhujade avibhuj...@yahoo.com Hi, I have two flex applications and I want to drag n drop display objects for one application to another application. Is this possible? if yes please provide some pointers. Thanks, Avi
[flexcoders] Drag and Drop snapping to objects together
Hi Guys and Gals, I am in the planning stage of writing a drag and drop application that allows the user to drag objects and drop them onto other objects, resulting in the two objects being snapped together. The application is that of a shelf with multiple slots, and individual cards that are dragged onto a particular slot, and when the drag is released, snapping that card to the slot. Afterwards, I would like the whole group of objects to behave as one draggable object. I am new to Flex, but I just need a little point in the right direction as to what classes, and methods I should look at to get me going. Thank you.
[flexcoders] Drag and drop issues
Hi All I have attached a simple example of the kind of things I want to do with dragging and dropping, namely dragging an object across different components in my app. In this example I have a list and two canvases and you can drag from the list to the canvases and between the canvases But I want make a few subtle but significant changes in my real app which have been causing problems for me so I thought I'd ask if anyone has any suggestions on the path to take. Otherwise I'll start building it up the way I do it in my current app and maybe someone can spot what I'm doing wrong. Here are the things I want to do 1. Actually move the object when dragging, not have a proxy shown and then the object move on drop. I found somewhere showing you could use the object itself instead of a proxy and I am doing that, but I have a horrible flicker when I start the move and I can't seem to get rid of it. Then my object randomly dissapear and I can't tell why :) (none of this is shown on the sample code though) 2. I don't want the animation on drop. It becomes more obvious when moving the actual object, but I just want to move the object and when they drop, have it stop. I have looked at the DragManager and it looks like there is no way to avoid this without monkey patching which is not acceptable. I am using the DragManger because the moves need to happen within the canvases as well as between them and I want the moves to be seamless. But if the only way to do this is to move them on the parent, do edge detection, and then initiate the drag when leaving, then please let me know. thanks, charles ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.controls.Label; import mx.core.UIComponent; import mx.controls.Alert; import mx.managers.DragManager; import mx.events.DragEvent; import mx.core.DragSource; private var _dragDownPt:Point; private function onDraggableItemMouseDown( event:MouseEvent ):void { var target:Canvas = Canvas( event.currentTarget ); var dragSource:DragSource = new DragSource(); _dragDownPt = new Point(event.localX, event.localY); dragSource.addData(_dragDownPt,dragOffset); DragManager.doDrag( target, dragSource, event, null, 0, 0, 0.5, true ); } private function onCanvasDragEnter( event:DragEvent ):void { DragManager.acceptDragDrop( Canvas( event.target ) ); } private function onCanvasDragDrop( event:DragEvent ):void { var dropCanvas:Canvas = event.currentTarget as Canvas; var dragOffset:Point = Point(event.dragSource.dataForFormat(dragOffset)); var child:Canvas; if (event.dragInitiator is Canvas ) { child = event.dragInitiator as Canvas; if(child.parent != dropCanvas) { child.parent.removeChild(child); dropCanvas.addChild(child); } } else { if (event.dragSource.hasFormat(items)) { if ( event.currentTarget.hasOwnProperty(hideDropFeedback) ) { event.currentTarget.hideDropFeedback(event); } var items:Array = event.dragSource.dataForFormat('items') as Array; child = createLabel(items[0].label); dropCanvas.addChild(child); } } if ( dragOffset != null ) { child.x = dropCanvas.mouseX - dragOffset.x; child.y = dropCanvas.mouseY - dragOffset.y; } else { child.x = dropCanvas.mouseX; child.y = dropCanvas.mouseY; } } private function createLabel(name:String):Canvas { var newChild:Canvas = new Canvas(); var label:Label = new Label(); label.text = name; newChild.addChild(label); label.x = 2; label.y = 2; newChild.addEventListener(MouseEvent.MOUSE_DOWN, onDraggableItemMouseDown, false, 0, false); newChild.width = 100; newChild.height = 20; newChild.setStyle(backgroundColor,#0FFF00); return newChild; } ]] /mx:Script mx:Model id=objects states state label=Alabama data=AL/ state label=Alaska data=AK/
[flexcoders] Drag and Drop
Hello, How to make Drag and Drop between 2 mx:Image ? Thank you, Christophe,
Re: [flexcoders] Drag and Drop
On Friday 20 Mar 2009, christophe_jacquelin wrote: How to make Drag and Drop between 2 mx:Image ? DragManager, like I said ~4h ago in reply to your other post. Having read the extensive documentation and example code, what is your specific problem ? -- Tom Chiverton Helping to confidentially initiate B2B sexy synergies as part of the IT team of the year, '09 and '08 This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com.
Re: [flexcoders] Drag and Drop
Christophe, Do you know the story about the wolf, the sheep and crying out wolf without a purpose? If not google for it :-) PS: Explanation: If you keep asking 20 questions a day on simple staff, without reading any tutorials, people will get pissed of and will not reply even when you need real help... On Fri, Mar 20, 2009 at 4:26 PM, christophe_jacquelin christophe_jacque...@yahoo.fr wrote: Hello, How to make Drag and Drop between 2 mx:Image ? Thank you, Christophe, -- Fotis Chatzinikos, Ph.D. Founder, Phinnovation fotis.chatzini...@gmail.com,
[flexcoders] drag and drop re-sort canvases in VBOX
Hi, I am looking for any example of implementing a drag and drop re-sort within a vbox container. Basically I have a Vbox that contains a number of canvas's that are full width and 50px high. I want to be able to drag and drop them to re-order within the vbox.
RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes)
Yes, all the data is in SQLite and available as an arraycollection to everything when creation complete kicks. I'm just trying to get the URL of an image that is already in a grid of images to be added to a presentation (within the presentation table) when the image is dropped on the presentation in the UI. _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jim Hayes Sent: Friday, January 30, 2009 5:30 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) But I'm still puzzled as to how to fire the proper SQL statement for each drop; essentially it's an INSERT [URL from drop] INTO table WHERE column = [the drop acceptor's label string]. So it's [URL from drop] and [the drop acceptor's label string] values that you need, essentially?, or you've already got those and want to know how to pass them elsewhere/use them to update the database? -Original Message- From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com [mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com] On Behalf Of David Kramer Sent: 30 January 2009 21:20 To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com Subject: RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) Yes! Last night around 2 AM I thought Oh, the item renderer should accept it and then I went to sleep. But I'm still puzzled as to how to fire the proper SQL statement for each drop; essentially it's an INSERT [URL from drop] INTO table WHERE column = [the drop acceptor's label string]. Example code rocks, of course, but small nudges will help me get through the fog. Thanks to all who keep illuminating... From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com [mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com] On Behalf Of Jim Hayes Sent: Friday, January 30, 2009 2:06 PM To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com Subject: RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) So I think what you really need to be doing is to have the list item renderer accept the drop, rather than the list itself? I'm sure I did this with the datagrid about a year and a half ago, unfortunately I don't have that project to hand just now or I'd have a look and see how I did it. All I remember was it wasn't all that hard to do once I'd got that concept. -Original Message- From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com [mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com] On Behalf Of David Kramer Sent: 30 January 2009 20:52 To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com Cc: kramer.david@ mailto:kramer.david%40consultant.com consultant.com Subject: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) Hello All. I've run into a problem, need other perspective(s)/solutions: Simply put: I want to implement drag and drop, like iTunes, in an AIR app. Seems easy, but...this particular scenario is puzzling. Right now, just like iTunes, I have two list-based controls (both are populated from collections of data within SQLite), one is a DataGrid and one is a List. Dragging and dropping from the Grid to the List is simple, yes, but I would like to drop on the list item's label/text/name in the List and perform another function (specifically an update to SQLite) and NOT simply drop the item and append to the list. Follow? As in iTunes, you can drag a song into a folder and it adds the song into the folder. (I would make that reference in SQLite in this case). It doesn't make a new folder by appending (wrongly) the dropped song to the folder list. (Which is what I have now: If I drag a item from the grid and drop it on the list, it's appended to the list, but I want it to become a value within the list item (pseudo nested) not a value in the list itself.) Is there a simple solution here I'm not seeing? Now, I can do all that neat stuff by dragging a grid item unto a mx:Button, but with only one button. Maybe I could loop/repeater to make a vertical stack of buttons from an array? But then it gets unclear as to how each button is created with the necessary dragEnter and dragDrop event handlers... any help here? This wheel has been invented before. So how in Flex? David (You can email me off of list if you'd like, I'll gladly post the solution at the end. kramer.david@ mailto:kramer.david%40consultant.com consultant.com) __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration
RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes)
I've explored many many options, but still cannot seem to get the item rendered in a list (the label) to be the drop target. It's always the damn list itself I really stripped down code to bare bones and pasted it below for simplicity and clarity, but...no dice. Another set of eyes please? ?xml version=1.0 encoding=utf-8? mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical initialize=init(); mx:Script ![CDATA[ import mx.controls.Label; import mx.collections.ArrayCollection; import mx.events.DragEvent; import mx.managers.DragManager; import mx.core.DragSource; import mx.utils.ObjectUtil; [Bindable] private var presentationDefaultCollection:ArrayCollection; [Bindable] private var imagesAcademicCollection:ArrayCollection; private function init():void { this.imagesAcademicCollection = new ArrayCollection(); this.imagesAcademicCollection.addItem({source:img/A01132009/highereducation 1-tn.jpg,title:Image 1,segment:Academic}); this.imagesAcademicCollection.addItem({source:img/A01132009/highereducation 2-tn.jpg,title:Image 2,segment:Academic}); this.imagesAcademicCollection.addItem({source:img/A01132009/highereducation 3-tn.jpg,title:Image 3,segment:Academic}); this.imagesAcademicCollection.addItem({source:img/A01132009/highereducation 4-tn.jpg,title:Image 4,segment:Academic}); this.imagesAcademicCollection.addItem({source:img/A01132009/highereducation 5-tn.jpg,title:Image 5,segment:Academic}); this.presentationDefaultCollection = new ArrayCollection(); this.presentationDefaultCollection.addItem({source:img/A01132009/highereduc ation1-tn.jpg,title:Presentation 1}); this.presentationDefaultCollection.addItem({source:img/A01132009/highereduc ation2-tn.jpg,title:Presentation 2}); this.presentationDefaultCollection.addItem({source:img/A01132009/highereduc ation3-tn.jpg,title:Presentation 3}); } private function dragEnterHandler(event:DragEvent):void { // Get the drop target component from the event object. var dropTarget:Label=event.currentTarget as Label; // Accept the drag only if the user is dragging data // identified by the 'value' format value. if (event.dragSource.hasFormat('value')) { // Accept the drop. DragManager.acceptDragDrop(dropTarget); trace('enter'); } } // Called if the target accepts the dragged object and the user // releases the mouse button while over the drop target. private function dragDropHandler(event:DragEvent):void { // Explicitly handle the dragDrop event. event.preventDefault(); // Get the data from the drag source. var value:String = event.dragSource.dataForFormat('value') as String; // Add Slide to the presentation sqlStuff(); } // Helper method for sql stuff private function sqlStuff():void { //the sql stuff trace('sql'); } ]] /mx:Script mx:HBox mx:DataGrid id=presentationGrid dataProvider={this.presentationDefaultCollection} width=200 mx:columns mx:DataGridColumn headerText=Presentations mx:itemRenderer mx:Component mx:Label text={data.title} dragEnter=dragEnterHandler(event); dragDrop=dragDropHandler(event); / /mx:Component /mx:itemRenderer /mx:DataGridColumn /mx:columns /mx:DataGrid mx:DataGrid id=slideGrid dataProvider={this.imagesAcademicCollection} dragEnabled=true width=200 mx:columns mx:DataGridColumn headerText=Slide dataField=title draggable=true / mx:DataGridColumn headerText=Segment dataField=segment draggable=true / /mx:columns /mx:DataGrid /mx:HBox /mx:WindowedApplication _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Friday, January 30, 2009 4:15 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) http://livedocs. http://livedocs.adobe.com/flex/3/html/dragdrop_8.html adobe.com/flex/3/html/dragdrop_8.html Now that only give you control over the drop functionality. You still need to extract the necessary key values form the source and target data, and build your update data structure and send it to the server, however you are doing that. Break this into steps. Make sure you can update the server with data from the source and target lists. Hard code the data as needed to test the Flex-server--database-server-flex process. You can choosw whether you want the drag operation to update the client target list or whether you want to return the new list data from the server and re-populate the list with that. When you can update the database successfully, implement the dragDrop handler, extract the key/data values form the source and target, and pass them to the function you created and tested in the step above. Tracy Spratt Lariat Services Flex development bandwidth available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of David Kramer Sent: Friday, January 30, 2009 4:10 PM To: flexcoders@yahoogroups.com Subject: RE
[flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes)
Hello All. I've run into a problem, need other perspective(s)/solutions: Simply put: I want to implement drag and drop, like iTunes, in an AIR app. Seems easy, but...this particular scenario is puzzling. Right now, just like iTunes, I have two list-based controls (both are populated from collections of data within SQLite), one is a DataGrid and one is a List. Dragging and dropping from the Grid to the List is simple, yes, but I would like to drop on the list item's label/text/name in the List and perform another function (specifically an update to SQLite) and NOT simply drop the item and append to the list. Follow? As in iTunes, you can drag a song into a folder and it adds the song into the folder. (I would make that reference in SQLite in this case). It doesn't make a new folder by appending (wrongly) the dropped song to the folder list. (Which is what I have now: If I drag a item from the grid and drop it on the list, it's appended to the list, but I want it to become a value within the list item (pseudo nested) not a value in the list itself.) Is there a simple solution here I'm not seeing? Now, I can do all that neat stuff by dragging a grid item unto a mx:Button, but with only one button. Maybe I could loop/repeater to make a vertical stack of buttons from an array? But then it gets unclear as to how each button is created with the necessary dragEnter and dragDrop event handlers. any help here? This wheel has been invented before. So how in Flex? David (You can email me off of list if you'd like, I'll gladly post the solution at the end. kramer.da...@consultant.com)
RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes)
If you write your own drag/drop handlers and call preventDefault, you can do anything you want, or nothing. There are lots of examples in the docs. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of David Kramer Sent: Friday, January 30, 2009 3:52 PM To: flexcoders@yahoogroups.com Cc: kramer.da...@consultant.com Subject: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) Hello All. I've run into a problem, need other perspective(s)/solutions: Simply put: I want to implement drag and drop, like iTunes, in an AIR app. Seems easy, but...this particular scenario is puzzling. Right now, just like iTunes, I have two list-based controls (both are populated from collections of data within SQLite), one is a DataGrid and one is a List. Dragging and dropping from the Grid to the List is simple, yes, but I would like to drop on the list item's label/text/name in the List and perform another function (specifically an update to SQLite) and NOT simply drop the item and append to the list. Follow? As in iTunes, you can drag a song into a folder and it adds the song into the folder. (I would make that reference in SQLite in this case). It doesn't make a new folder by appending (wrongly) the dropped song to the folder list. (Which is what I have now: If I drag a item from the grid and drop it on the list, it's appended to the list, but I want it to become a value within the list item (pseudo nested) not a value in the list itself.) Is there a simple solution here I'm not seeing? Now, I can do all that neat stuff by dragging a grid item unto a mx:Button, but with only one button. Maybe I could loop/repeater to make a vertical stack of buttons from an array? But then it gets unclear as to how each button is created with the necessary dragEnter and dragDrop event handlers... any help here? This wheel has been invented before. So how in Flex? David (You can email me off of list if you'd like, I'll gladly post the solution at the end. kramer.da...@consultant.com mailto:kramer.da...@consultant.com )
RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes)
So I think what you really need to be doing is to have the list item renderer accept the drop, rather than the list itself? I'm sure I did this with the datagrid about a year and a half ago, unfortunately I don't have that project to hand just now or I'd have a look and see how I did it. All I remember was it wasn't all that hard to do once I'd got that concept. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of David Kramer Sent: 30 January 2009 20:52 To: flexcoders@yahoogroups.com Cc: kramer.da...@consultant.com Subject: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) Hello All. I've run into a problem, need other perspective(s)/solutions: Simply put: I want to implement drag and drop, like iTunes, in an AIR app. Seems easy, but...this particular scenario is puzzling. Right now, just like iTunes, I have two list-based controls (both are populated from collections of data within SQLite), one is a DataGrid and one is a List. Dragging and dropping from the Grid to the List is simple, yes, but I would like to drop on the list item's label/text/name in the List and perform another function (specifically an update to SQLite) and NOT simply drop the item and append to the list. Follow? As in iTunes, you can drag a song into a folder and it adds the song into the folder. (I would make that reference in SQLite in this case). It doesn't make a new folder by appending (wrongly) the dropped song to the folder list. (Which is what I have now: If I drag a item from the grid and drop it on the list, it's appended to the list, but I want it to become a value within the list item (pseudo nested) not a value in the list itself.) Is there a simple solution here I'm not seeing? Now, I can do all that neat stuff by dragging a grid item unto a mx:Button, but with only one button. Maybe I could loop/repeater to make a vertical stack of buttons from an array? But then it gets unclear as to how each button is created with the necessary dragEnter and dragDrop event handlers... any help here? This wheel has been invented before. So how in Flex? David (You can email me off of list if you'd like, I'll gladly post the solution at the end. kramer.da...@consultant.com mailto:kramer.da...@consultant.com ) __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __
RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes)
Thanks for the super fast reply, Tracy. I will look of course, but for even more speed, do you have a link to reference? Thanks in advance. _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Friday, January 30, 2009 2:00 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) If you write your own drag/drop handlers and call preventDefault, you can do anything you want, or nothing. There are lots of examples in the docs. Tracy Spratt Lariat Services Flex development bandwidth available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of David Kramer Sent: Friday, January 30, 2009 3:52 PM To: flexcoders@yahoogroups.com Cc: kramer.da...@consultant.com Subject: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) Hello All. I've run into a problem, need other perspective(s)/solutions: Simply put: I want to implement drag and drop, like iTunes, in an AIR app. Seems easy, but...this particular scenario is puzzling. Right now, just like iTunes, I have two list-based controls (both are populated from collections of data within SQLite), one is a DataGrid and one is a List. Dragging and dropping from the Grid to the List is simple, yes, but I would like to drop on the list item's label/text/name in the List and perform another function (specifically an update to SQLite) and NOT simply drop the item and append to the list. Follow? As in iTunes, you can drag a song into a folder and it adds the song into the folder. (I would make that reference in SQLite in this case). It doesn't make a new folder by appending (wrongly) the dropped song to the folder list. (Which is what I have now: If I drag a item from the grid and drop it on the list, it's appended to the list, but I want it to become a value within the list item (pseudo nested) not a value in the list itself.) Is there a simple solution here I'm not seeing? Now, I can do all that neat stuff by dragging a grid item unto a mx:Button, but with only one button. Maybe I could loop/repeater to make a vertical stack of buttons from an array? But then it gets unclear as to how each button is created with the necessary dragEnter and dragDrop event handlers. any help here? This wheel has been invented before. So how in Flex? David (You can email me off of list if you'd like, I'll gladly post the solution at the end. kramer.david@ mailto:kramer.da...@consultant.com consultant.com)
RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes)
Yes! Last night around 2 AM I thought Oh, the item renderer should accept it and then I went to sleep. But I'm still puzzled as to how to fire the proper SQL statement for each drop; essentially it's an INSERT [URL from drop] INTO table WHERE column = [the drop acceptor's label string]. Example code rocks, of course, but small nudges will help me get through the fog. Thanks to all who keep illuminating... _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jim Hayes Sent: Friday, January 30, 2009 2:06 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) So I think what you really need to be doing is to have the list item renderer accept the drop, rather than the list itself? I'm sure I did this with the datagrid about a year and a half ago, unfortunately I don't have that project to hand just now or I'd have a look and see how I did it. All I remember was it wasn't all that hard to do once I'd got that concept. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of David Kramer Sent: 30 January 2009 20:52 To: flexcoders@yahoogroups.com Cc: kramer.da...@consultant.com Subject: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) Hello All. I've run into a problem, need other perspective(s)/solutions: Simply put: I want to implement drag and drop, like iTunes, in an AIR app. Seems easy, but...this particular scenario is puzzling. Right now, just like iTunes, I have two list-based controls (both are populated from collections of data within SQLite), one is a DataGrid and one is a List. Dragging and dropping from the Grid to the List is simple, yes, but I would like to drop on the list item's label/text/name in the List and perform another function (specifically an update to SQLite) and NOT simply drop the item and append to the list. Follow? As in iTunes, you can drag a song into a folder and it adds the song into the folder. (I would make that reference in SQLite in this case). It doesn't make a new folder by appending (wrongly) the dropped song to the folder list. (Which is what I have now: If I drag a item from the grid and drop it on the list, it's appended to the list, but I want it to become a value within the list item (pseudo nested) not a value in the list itself.) Is there a simple solution here I'm not seeing? Now, I can do all that neat stuff by dragging a grid item unto a mx:Button, but with only one button. Maybe I could loop/repeater to make a vertical stack of buttons from an array? But then it gets unclear as to how each button is created with the necessary dragEnter and dragDrop event handlers. any help here? This wheel has been invented before. So how in Flex? David (You can email me off of list if you'd like, I'll gladly post the solution at the end. kramer.david@ mailto:kramer.da...@consultant.com consultant.com) __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __
RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes)
http://livedocs.adobe.com/flex/3/html/dragdrop_8.html Now that only give you control over the drop functionality. You still need to extract the necessary key values form the source and target data, and build your update data structure and send it to the server, however you are doing that. Break this into steps. Make sure you can update the server with data from the source and target lists. Hard code the data as needed to test the Flex-server--database-server-flex process. You can choosw whether you want the drag operation to update the client target list or whether you want to return the new list data from the server and re-populate the list with that. When you can update the database successfully, implement the dragDrop handler, extract the key/data values form the source and target, and pass them to the function you created and tested in the step above. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of David Kramer Sent: Friday, January 30, 2009 4:10 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) Thanks for the super fast reply, Tracy. I will look of course, but for even more speed, do you have a link to reference? Thanks in advance. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Friday, January 30, 2009 2:00 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) If you write your own drag/drop handlers and call preventDefault, you can do anything you want, or nothing. There are lots of examples in the docs. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of David Kramer Sent: Friday, January 30, 2009 3:52 PM To: flexcoders@yahoogroups.com Cc: kramer.da...@consultant.com Subject: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) Hello All. I've run into a problem, need other perspective(s)/solutions: Simply put: I want to implement drag and drop, like iTunes, in an AIR app. Seems easy, but...this particular scenario is puzzling. Right now, just like iTunes, I have two list-based controls (both are populated from collections of data within SQLite), one is a DataGrid and one is a List. Dragging and dropping from the Grid to the List is simple, yes, but I would like to drop on the list item's label/text/name in the List and perform another function (specifically an update to SQLite) and NOT simply drop the item and append to the list. Follow? As in iTunes, you can drag a song into a folder and it adds the song into the folder. (I would make that reference in SQLite in this case). It doesn't make a new folder by appending (wrongly) the dropped song to the folder list. (Which is what I have now: If I drag a item from the grid and drop it on the list, it's appended to the list, but I want it to become a value within the list item (pseudo nested) not a value in the list itself.) Is there a simple solution here I'm not seeing? Now, I can do all that neat stuff by dragging a grid item unto a mx:Button, but with only one button. Maybe I could loop/repeater to make a vertical stack of buttons from an array? But then it gets unclear as to how each button is created with the necessary dragEnter and dragDrop event handlers... any help here? This wheel has been invented before. So how in Flex? David (You can email me off of list if you'd like, I'll gladly post the solution at the end. kramer.da...@consultant.com mailto:kramer.da...@consultant.com )
RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes)
But I'm still puzzled as to how to fire the proper SQL statement for each drop; essentially it's an INSERT [URL from drop] INTO table WHERE column = [the drop acceptor's label string]. So it's [URL from drop] and [the drop acceptor's label string] values that you need, essentially?, or you've already got those and want to know how to pass them elsewhere/use them to update the database? -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of David Kramer Sent: 30 January 2009 21:20 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) Yes! Last night around 2 AM I thought Oh, the item renderer should accept it and then I went to sleep. But I'm still puzzled as to how to fire the proper SQL statement for each drop; essentially it's an INSERT [URL from drop] INTO table WHERE column = [the drop acceptor's label string]. Example code rocks, of course, but small nudges will help me get through the fog. Thanks to all who keep illuminating... From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jim Hayes Sent: Friday, January 30, 2009 2:06 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) So I think what you really need to be doing is to have the list item renderer accept the drop, rather than the list itself? I'm sure I did this with the datagrid about a year and a half ago, unfortunately I don't have that project to hand just now or I'd have a look and see how I did it. All I remember was it wasn't all that hard to do once I'd got that concept. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of David Kramer Sent: 30 January 2009 20:52 To: flexcoders@yahoogroups.com Cc: kramer.da...@consultant.com Subject: [flexcoders] drag and drop ('into' the list items, while not adding to the list itself; Ex: iTunes) Hello All. I've run into a problem, need other perspective(s)/solutions: Simply put: I want to implement drag and drop, like iTunes, in an AIR app. Seems easy, but...this particular scenario is puzzling. Right now, just like iTunes, I have two list-based controls (both are populated from collections of data within SQLite), one is a DataGrid and one is a List. Dragging and dropping from the Grid to the List is simple, yes, but I would like to drop on the list item's label/text/name in the List and perform another function (specifically an update to SQLite) and NOT simply drop the item and append to the list. Follow? As in iTunes, you can drag a song into a folder and it adds the song into the folder. (I would make that reference in SQLite in this case). It doesn't make a new folder by appending (wrongly) the dropped song to the folder list. (Which is what I have now: If I drag a item from the grid and drop it on the list, it's appended to the list, but I want it to become a value within the list item (pseudo nested) not a value in the list itself.) Is there a simple solution here I'm not seeing? Now, I can do all that neat stuff by dragging a grid item unto a mx:Button, but with only one button. Maybe I could loop/repeater to make a vertical stack of buttons from an array? But then it gets unclear as to how each button is created with the necessary dragEnter and dragDrop event handlers... any help here? This wheel has been invented before. So how in Flex? David (You can email me off of list if you'd like, I'll gladly post the solution at the end. kramer.da...@consultant.com) __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __ __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have
RE: [flexcoders] Drag And Drop Tree
I don't have time to look into it more right now. There is drop-in-a-folder logic for empty folders in Tree. Maybe you can leverage that logic. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of claudiu ursica Sent: Monday, January 19, 2009 1:28 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Drag And Drop Tree It can be moved around but cannot be dropped into a folder (branch) unless the folder is open. I was adding those handlers, so that i can drop item/items inside a closed node... And it works for branches but not for leaf nodes ... Setting breakpoints in drag/drop generally doesn’t work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. The funny thing is that the accurate data seems to be there at a certain time when debugged, and i tried to store it in a private member of the component and that works fine for branches, it seems that it just looses the data it probably when dragging over a branch or I don''t know, but the length is still one so I end up in adding an empty leaf. That also happens for the dragComplete handler. Still adding an empty leaf... From: Alex Harui aha...@adobe.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Monday, January 19, 2009 11:01:07 PM Subject: RE: [flexcoders] Drag And Drop Tree If I remove your handlers, I can move Sent just fine. In your handler the following line is suspicious: var xml : XML = new XML(items); because items is an array. Use XML.toXMLString( ) to make sure you’re trying to put in valid data. From: flexcod...@yahoogro ups.comhttp://ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of claudiu ursica Sent: Monday, January 19, 2009 12:30 AM To: flexcod...@yahoogro ups.com Subject: Re: [flexcoders] Drag And Drop Tree Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu From: Alex Harui aha...@adobe. com To: flexcod...@yahoogro ups.com flexcod...@yahoogro ups.com Sent: Monday, January 19, 2009 7:47:53 AM Subject: RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn’t work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler From: flexcod...@yahoogro ups.comhttp://ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Claudiu Ursica Sent: Sunday, January 18, 2009 9:59 AM To: flexcod...@yahoogro ups.com Subject: [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro
Re: [flexcoders] Drag And Drop Tree
Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu From: Alex Harui aha...@adobe.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Monday, January 19, 2009 7:47:53 AM Subject: RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn’t work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Claudiu Ursica Sent: Sunday, January 18, 2009 9:59 AM To: flexcod...@yahoogro ups.com Subject: [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro pIndex(event) ; myTree.selectedInde x = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescr iptor.hasChildre n(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent( ); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. var xml : XML = new XML(items); var sucess : Boolean = myTree.dataDescript or.addChildAt( dropParent, xml, selectedIndex) ; //trace(sucess) ; } ]] /mx:Script mx:Tree id=myTree width=300 height=100% labelField=@label showRoot=false dataProvider={treeData} borderStyle=none dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=onDragEnter( event) dragDrop=onDragDrop(event) /mx:Tree mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ node label=Inbox node label=Marketing/ node label=Product Management/ /node node label=Personal/ /node node label=De mutat node label=Unu/ node label=Doi/ node label=DoiUnu node label=DoiUnuUnu/ node label=DoiUNuDoi/ /node node label=Trei/ /node node label=Spamu/ node label=Sent/ node label=Movable/ /node /mx:XMLList /mx:Application so the code seems to be working when drag and dropping an folder but not when dropping a leaf, I get a new Item with no label. I have searched the archives for something similar and found only the same issue posted twice by 2 different guys and no answers. So I thought I'll have
Re: [flexcoders] Drag And Drop Tree
Are you using a custom event? And if so, did you implement the clone method? 2009/1/19 claudiu ursica the_bran...@yahoo.com Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu -- *From:* Alex Harui aha...@adobe.com *To:* flexcoders@yahoogroups.com flexcoders@yahoogroups.com *Sent:* Monday, January 19, 2009 7:47:53 AM *Subject:* RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn't work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler *From:* flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] *On Behalf Of *Claudiu Ursica *Sent:* Sunday, January 18, 2009 9:59 AM *To:* flexcod...@yahoogro ups.com *Subject:* [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro pIndex(event) ; myTree.selectedInde x = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescr iptor.hasChildre n(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent( ); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. var xml : XML = new XML(items); var sucess : Boolean = myTree.dataDescript or.addChildAt( dropParent, xml, selectedIndex) ; //trace(sucess) ; } ]] /mx:Script mx:Tree id=myTree width=300 height=100% labelField=@label showRoot=false dataProvider={treeData} borderStyle=none dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=onDragEnter( event) dragDrop=onDragDrop(event) /mx:Tree mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ node label=Inbox node label=Marketing/ node label=Product Management/ /node node label=Personal/ /node node label=De mutat node label=Unu/ node label=Doi/ node label=DoiUnu node label=DoiUnuUnu/ node label=DoiUNuDoi/ /node node label=Trei/ /node node label=Spamu/ node label=Sent/ node label=Movable/ /node /mx:XMLList
Re: [flexcoders] Drag And Drop Tree
No custom event just the usual DragDrop events dispatched by the tree e.g. dragStart, dragOver, dragDrop, dragComplete... Claudiu... From: Sefi Ninio sefi.ni...@gmail.com To: flexcoders@yahoogroups.com Sent: Monday, January 19, 2009 11:25:35 AM Subject: Re: [flexcoders] Drag And Drop Tree Are you using a custom event? And if so, did you implement the clone method? 2009/1/19 claudiu ursica the_braniak@ yahoo.com Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu From: Alex Harui aha...@adobe. com To: flexcod...@yahoogro ups.com flexcod...@yahoogro ups.com Sent: Monday, January 19, 2009 7:47:53 AM Subject: RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn't work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Claudiu Ursica Sent: Sunday, January 18, 2009 9:59 AM To: flexcod...@yahoogro ups.com Subject: [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro pIndex(event) ; myTree.selectedInde x = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescr iptor.hasChildre n(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent( ); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. var xml : XML = new XML(items); var sucess : Boolean = myTree.dataDescript or.addChildAt( dropParent, xml, selectedIndex) ; //trace(sucess) ; } ]] /mx:Script mx:Tree id=myTree width=300 height=100% labelField=@label showRoot=false dataProvider={treeData} borderStyle=none dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=onDragEnter( event) dragDrop=onDragDrop(event) /mx:Tree mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ node label=Inbox node label=Marketing/ node label=Product Management/ /node node label=Personal/ /node node label=De mutat node label=Unu/ node label
RE: [flexcoders] Drag And Drop Tree
If I remove your handlers, I can move Sent just fine. In your handler the following line is suspicious: var xml : XML = new XML(items); because items is an array. Use XML.toXMLString() to make sure you're trying to put in valid data. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of claudiu ursica Sent: Monday, January 19, 2009 12:30 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Drag And Drop Tree Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu From: Alex Harui aha...@adobe.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Monday, January 19, 2009 7:47:53 AM Subject: RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn’t work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler From: flexcod...@yahoogro ups.comhttp://ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Claudiu Ursica Sent: Sunday, January 18, 2009 9:59 AM To: flexcod...@yahoogro ups.com Subject: [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro pIndex(event) ; myTree.selectedInde x = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescr iptor.hasChildre n(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent( ); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. var xml : XML = new XML(items); var sucess : Boolean = myTree.dataDescript or.addChildAt( dropParent, xml, selectedIndex) ; //trace(sucess) ; } ]] /mx:Script mx:Tree id=myTree width=300 height=100% labelField=@label showRoot=false dataProvider={treeData} borderStyle=none dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=onDragEnter( event) dragDrop=onDragDrop(event) /mx:Tree mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ node label=Inbox node label=Marketing/ node label=Product Management/ /node node label=Personal/ /node node label=De mutat node label
Re: [flexcoders] Drag And Drop Tree
It can be moved around but cannot be dropped into a folder (branch) unless the folder is open. I was adding those handlers, so that i can drop item/items inside a closed node... And it works for branches but not for leaf nodes ... Setting breakpoints in drag/drop generally doesn’t work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. The funny thing is that the accurate data seems to be there at a certain time when debugged, and i tried to store it in a private member of the component and that works fine for branches, it seems that it just looses the data it probably when dragging over a branch or I don''t know, but the length is still one so I end up in adding an empty leaf. That also happens for the dragComplete handler. Still adding an empty leaf... From: Alex Harui aha...@adobe.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Monday, January 19, 2009 11:01:07 PM Subject: RE: [flexcoders] Drag And Drop Tree If I remove your handlers, I can move Sent just fine. In your handler the following line is suspicious: var xml : XML = new XML(items); because items is an array. Use XML.toXMLString( ) to make sure you’re trying to put in valid data. From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of claudiu ursica Sent: Monday, January 19, 2009 12:30 AM To: flexcod...@yahoogro ups.com Subject: Re: [flexcoders] Drag And Drop Tree Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu From:Alex Harui aha...@adobe. com To: flexcod...@yahoogro ups.com flexcod...@yahoogro ups.com Sent: Monday, January 19, 2009 7:47:53 AM Subject: RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn’t work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Claudiu Ursica Sent: Sunday, January 18, 2009 9:59 AM To: flexcod...@yahoogro ups.com Subject: [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro pIndex(event) ; myTree.selectedInde x = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescr iptor.hasChildre n(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent( ); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer
[flexcoders] Drag And Drop Tree
Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent; import mx.managers.DragManager; import mx.core.UIComponent; import mx.core.DragSource; private function onDragEnter(event : DragEvent) : void { var items : Array = event.dragSource.dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentTarget); var selectedIndex : int = myTree.calculateDropIndex(event); myTree.selectedIndex = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescriptor.hasChildren(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent(); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. var xml : XML = new XML(items); var sucess : Boolean = myTree.dataDescriptor.addChildAt(dropParent, xml, selectedIndex); //trace(sucess); } ]] /mx:Script mx:Tree id=myTree width=300 height=100% labelField=@label showRoot=false dataProvider={treeData} borderStyle=none dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=onDragEnter(event) dragDrop=onDragDrop(event) /mx:Tree mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/
RE: [flexcoders] Drag And Drop Tree
Setting breakpoints in drag/drop generally doesn't work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Claudiu Ursica Sent: Sunday, January 18, 2009 9:59 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent; import mx.managers.DragManager; import mx.core.UIComponent; import mx.core.DragSource; private function onDragEnter(event : DragEvent) : void { var items : Array = event.dragSource.dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentTarget); var selectedIndex : int = myTree.calculateDropIndex(event); myTree.selectedIndex = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescriptor.hasChildren(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent(); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. var xml : XML = new XML(items); var sucess : Boolean = myTree.dataDescriptor.addChildAt(dropParent, xml, selectedIndex); //trace(sucess); } ]] /mx:Script mx:Tree id=myTree width=300 height=100% labelField=@label showRoot=false dataProvider={treeData} borderStyle=none dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=onDragEnter(event) dragDrop=onDragDrop(event) /mx:Tree mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ node label=Inbox node label=Marketing/ node label=Product Management/ /node node label=Personal/ /node node label=De mutat node label=Unu/ node label=Doi/ node label=DoiUnu node label=DoiUnuUnu/ node label=DoiUNuDoi/ /node node label=Trei/ /node node label=Spamu/ node label=Sent/ node label=Movable/ /node /mx:XMLList /mx:Application so the code seems to be working when drag and dropping an folder but not when dropping a leaf, I get a new Item with no label. I have searched the archives for something similar and found only the same issue posted twice by 2 different guys and no answers. So I thought I'll have better luck... TIA, Claudiu
[flexcoders] Drag an Drop on images
Hello, How to make the equivalent of drag and drop of images on a screen in a flex application ? Thank you, Christophe,
RE: [flexcoders] Drag an Drop on images
Assuming you are not working with controls that support DnD by default, you use a mouse gesture to start the drag operation, ceate a Dragsource, add your data to it, then use DragManager.doDrag() to start the drag. The docs have good examples. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of christophe_jacquelin Sent: Friday, January 16, 2009 7:06 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag an Drop on images Hello, How to make the equivalent of drag and drop of images on a screen in a flex application ? Thank you, Christophe,
Re: [flexcoders] Drag and Drop into a Popup Window
Hello Alex, thanks for your answer! it was my fault. I didn't specified the proper event handlers in the drop target. It's working quite fine now. Sorry for the disturbance.. Cheers Reto 2008/12/8 Alex Harui [EMAIL PROTECTED]: What didn't work? Post a mini-example. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Reto M. Kiefer Sent: Monday, December 08, 2008 1:25 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag and Drop into a Popup Window Dear all, I want to drag and drop data from the main application into field in a popup window. The usual handling of dragEnter and dragDrop doesn't work. Any hints / links on how to enable drag and drop into a popup window is highly appreciated. Thanks in advance Reto
[flexcoders] Drag and Drop into a Popup Window
Dear all, I want to drag and drop data from the main application into field in a popup window. The usual handling of dragEnter and dragDrop doesn't work. Any hints / links on how to enable drag and drop into a popup window is highly appreciated. Thanks in advance Reto
RE: [flexcoders] Drag and Drop into a Popup Window
What didn't work? Post a mini-example. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Reto M. Kiefer Sent: Monday, December 08, 2008 1:25 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag and Drop into a Popup Window Dear all, I want to drag and drop data from the main application into field in a popup window. The usual handling of dragEnter and dragDrop doesn't work. Any hints / links on how to enable drag and drop into a popup window is highly appreciated. Thanks in advance Reto
RE: [flexcoders] Drag and drop module
http://blogs.adobe.com/aharui/2007/08/popup_dialogs_as_modules.html From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Claudiu Ursica Sent: Monday, November 10, 2008 5:04 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag and drop module Hi, I have a module who contains a TitleWindow. In the main application i use a ModuleLoader to loads that module at a certain time (when I click a button to be more precise). Everything works fine until I want to move the frehly loaded TitleWindow (from the module) on the screen. I am not able to maket it move when clicking it. If anyone has any input on this it will be appreciated. TIA, Claudiu
[flexcoders] drag and drop from Tree to List
I have a tree and a list that I'd like to use drag and drop on to do the following: 1. Do reordering in the list (ie move the items around) 2. Drag items from the tree to the list in order to copy items The problem I'm experiencing is that when I turn on dropEnabled=true on the list the reordering of the list works fine however it stops allowing the tree to drop items on the list even if I explicitly set a drag enter function list this public function onDragEnter( event:DragEvent ) : void { DragManager.acceptDragDrop(List(event.currentTarget)); }
Re: [flexcoders] drag and drop from Tree to List
Hi I am not sure I get that but in general if you drag and drop from lets' say 'A' to B' ,I have used to drag and drop both ways from one list to another and I did is as follows A.dragMoveEnabled=true; A.dragEnabled=true; A.dropEnabled=true; B.dragMoveEnabled=true; B.dragEnabled=true; B.dropEnabled=true; Thats worked in my case , i was moving entries though. Hope that helps Anuj On Mon, Nov 10, 2008 at 11:14 AM, graysonpierce [EMAIL PROTECTED]wrote: I have a tree and a list that I'd like to use drag and drop on to do the following: 1. Do reordering in the list (ie move the items around) 2. Drag items from the tree to the list in order to copy items The problem I'm experiencing is that when I turn on dropEnabled=true on the list the reordering of the list works fine however it stops allowing the tree to drop items on the list even if I explicitly set a drag enter function list this public function onDragEnter( event:DragEvent ) : void { DragManager.acceptDragDrop(List(event.currentTarget)); }
RE: [flexcoders] drag and drop from Tree to List
Because the dataProviders are presumably dissimilar, with the tree being hierarchical and the list being linear, you will not be able to depend on the built-in functionality, but will need to override the drag handler functions, and update the dataProviders yourself. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of graysonpierce Sent: Monday, November 10, 2008 2:14 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] drag and drop from Tree to List I have a tree and a list that I'd like to use drag and drop on to do the following: 1. Do reordering in the list (ie move the items around) 2. Drag items from the tree to the list in order to copy items The problem I'm experiencing is that when I turn on dropEnabled=true on the list the reordering of the list works fine however it stops allowing the tree to drop items on the list even if I explicitly set a drag enter function list this public function onDragEnter( event:DragEvent ) : void { DragManager.acceptDragDrop(List(event.currentTarget)); }
[flexcoders] Drag and drop module
Hi, I have a module who contains a TitleWindow. In the main application i use a ModuleLoader to loads that module at a certain time (when I click a button to be more precise). Everything works fine until I want to move the frehly loaded TitleWindow (from the module) on the screen. I am not able to maket it move when clicking it. If anyone has any input on this it will be appreciated. TIA, Claudiu
[flexcoders] Drag and drop to a TabBar
Hello, I am trying to drag an item from a DataGrid onto a TabBar, which eventually is supposed to cause changes in the original datagrid. In order to implement this feature, I have manually enabled the dragDrop and dragEnter methods for the TabBar. On the application, I can see successfully drag the item and drop it to the TabBar. In order to proceed forward, I want to programatically find the Tab where the item is being dropped. Within the dragDrop handler function I can get the target TabBar from the event. However I am not able to get the specific tab where the drop occurred. This obviously is very important to my implementation as the eventual change in my DataGrid is dependent on the value of the target Tab. Can someone please help me with sample code to perform this? In other words show me how to get the data about the tab where the drop action takes place. Thanks Abhishek
[flexcoders] drag and drop in flex
hello all, could anyone tell me how can we allow users to drag controls like datagrid , slider ,etc from 1 canvas to anather ? [EMAIL PROTECTED]
[flexcoders] Drag and Drop question
I am trying to implement drag and drop onto a tree. In the dropDrop handler, I want to be able to deny the drop from happening, based on which element of the tree is being dropped on. // r is the visible index in the tree var dropTarget:Tree = Tree(event.currentTarget); var r:int = dropTarget.calculateDropIndex(event); dstXmlTree.selectedIndex = r; var node:XML = dstXmlTree.selectedItem as XML; if (node.toXMLSting == whatever) { // Allow drop -- HOW? } else { // Do NOT allow drop -- HOW? } How do I deny the drop? thanks!
Re: [flexcoders] Drag and Drop question
I believe you're going to need to handle the drop events yourself and not use the dropEnabled=true setting. When you do that, by default drop is denied and you have to tell it to allow it, like in the dragEnter event. For example: private function dragEnterHandler(e:DragEvent):void { DragManager.acceptDragDrop(UIComponent(e.currentTarget)); DragManager.showFeedback(DragManager.COPY); } On Tue, Sep 16, 2008 at 9:59 AM, zootpeet [EMAIL PROTECTED] wrote: I am trying to implement drag and drop onto a tree. In the dropDrop handler, I want to be able to deny the drop from happening, based on which element of the tree is being dropped on. // r is the visible index in the tree var dropTarget:Tree = Tree(event.currentTarget); var r:int = dropTarget.calculateDropIndex(event); dstXmlTree.selectedIndex = r; var node:XML = dstXmlTree.selectedItem as XML; if (node.toXMLSting == whatever) { // Allow drop -- HOW? } else { // Do NOT allow drop -- HOW? } How do I deny the drop? thanks! -- Jason
RE: [flexcoders] Drag and Drop question
I use the dropEnabled setting, but in all of the handlers, I call event.preventDefault(); Then I test the source and target and call DragManager.showFeedback(), DragManager.acceptDragDrop() conditionally as required. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Pan Troglodytes Sent: Tuesday, September 16, 2008 11:20 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Drag and Drop question I believe you're going to need to handle the drop events yourself and not use the dropEnabled=true setting. When you do that, by default drop is denied and you have to tell it to allow it, like in the dragEnter event. For example: private function dragEnterHandler(e:DragEvent):void { DragManager.acceptDragDrop(UIComponent(e.currentTarget)); DragManager.showFeedback(DragManager.COPY); } On Tue, Sep 16, 2008 at 9:59 AM, zootpeet [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I am trying to implement drag and drop onto a tree. In the dropDrop handler, I want to be able to deny the drop from happening, based on which element of the tree is being dropped on. // r is the visible index in the tree var dropTarget:Tree = Tree(event.currentTarget); var r:int = dropTarget.calculateDropIndex(event); dstXmlTree.selectedIndex = r; var node:XML = dstXmlTree.selectedItem as XML; if (node.toXMLSting == whatever) { // Allow drop -- HOW? } else { // Do NOT allow drop -- HOW? } How do I deny the drop? thanks! -- Jason
[flexcoders] Drag and drop steals all mouse events
Ok, so I guess this is fair enough. But what happens when you need to know the xmouse and ymouse position during the drag operation? Can anyone help out here? There _has_ to be a way to do this. I need to provide visual feedback in my component that requires knowing the mouse's location during a drag-and-drop operation. Thanks in advance, Mike
RE: [flexcoders] Drag and drop steals all mouse events
J I had this issue a few days ago and spent a few hours trying lots of weird and wonderful ways of trying to figure out where the mouse was, then within 5 mins of posting to flexcoders (typical really) I remembered that I could just listen to the drag event (enter / over should do). From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Pearce Sent: 24 July 2008 07:37 To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag and drop steals all mouse events Ok, so I guess this is fair enough... But what happens when you need to know the xmouse and ymouse position during the drag operation? Can anyone help out here? There _has_ to be a way to do this... I need to provide visual feedback in my component that requires knowing the mouse's location during a drag-and-drop operation. Thanks in advance, Mike Disclaimer --- This electronic message contains information which may be privileged and confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone on 0131 476 6000 and delete the material from your computer. Registered in Scotland number: SC 172507. Registered office address: Quay House 142 Commercial Street Edinburgh EH6 6LB. This email message has been scanned for viruses by Mimecast. ---
RE: [flexcoders] Drag and drop steals all mouse events
DragOver.. Have no idea how I missed it! Thanks Kenneth =)
[flexcoders] drag and drop in air cairngorm app
I have tested some code in a seperate application and everything is fine. In my app I am using Cairngorm and I have a custom view. My main file is pretty simple as you can see below. The problem I having is that in the custom view I can never get the dragdrop to fire. The enter and exit trace statements execute just fine. As I said, I set up a test app and this seems to work fine. Anyone know what im doing wrong here? MAIN mx:ViewStack id=viewStackManager selectedIndex={modelLocator.workflowState} width=100% height=100% view:LoginForm/ view:CustomView/ /mx:ViewStack CUSTOM VIEW ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=init() mx:Script ![CDATA[ import com.**.uploader.model.ModelLocator; import flash.events.NativeDragEvent; [Bindable] private var modelLocator:ModelLocator = ModelLocator.getInstance(); private function init():void { this.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP,onDrop); this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER,onEnter); this.addEventListener(NativeDragEvent.NATIVE_DRAG_EXIT,onExit); trace(init); } private function onDrop(event:NativeDragEvent):void { trace(Drag Drop); } private function onEnter(event:NativeDragEvent):void { trace(Drag Enter); NativeDragManager.acceptDragDrop(this); } private function onExit(event:NativeDragEvent):void { trace(Drag Exit); } ]] /mx:Script mx:List id=fileList width=100% height=100% backgroundColor=#ff dropEnabled=true paddingTop=10 paddingRight=10 paddingBottom=10 paddingLeft=10 /mx:List /mx:Canvas Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
[flexcoders] Drag and drop. From an image to a box
I have a strange behavior for me as a newbie. I have an image which I drop to a box. The image is accepted if only if the box is white. I cannot figure it out the reason of this behavior. The code, ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; height=641 mx:Model id=modelo jugadores jugador nombreFernando/nombre posicion16/posicion potencia100%/potencia fotoimagenes/foto.jpg/foto /jugador jugador nombreAgustin/nombre posicion10/posicion potencia90%/potencia fotoimagenes/foto.jpg/foto /jugador jugador nombreEzequiel/nombre posicion1/posicion potencia10%/potencia fotoimagenes/foto.jpg/foto /jugador /jugadores /mx:Model mx:Script ![CDATA[ import mx.events.DragEvent; import mx.containers.Box; import mx.managers.DragManager; import mx.core.DragSource; public function mouseMove(event:MouseEvent):void{ // Get the drag initiator component from the event object. var dragInitiator:Image = event.currentTarget as Image; // Create a DragSource object. var dragSource:DragSource = new DragSource(); var dragProxy:Image = new Image(); dragProxy.source = event.currentTarget.source; dragProxy.width=dragInitiator.width; dragProxy.height=dragInitiator.height; // Call the DragManager doDrag() method to start the drag. DragManager.doDrag(dragInitiator, dragSource, event, dragProxy); } // Called if the user drags a drag proxy onto the drop target. private function dragEnterHandler(event:DragEvent):void { trace(entre); var dropTarget:Box=event.currentTarget as Box; DragManager.acceptDragDrop(dropTarget); trace(acepto: + event.currentTarget); } ]] /mx:Script mx:Box mx:Panel width=542 height=404 layout=absolute mx:Image id=sdf x=0 y=0 width=407 height=364 source=imagenes/partido.jpg / mx:Image id=asd source=imagenes/foto.jpg width=24 height=28 x=290 y=104 mouseMove=mouseMove(event); / mx:Box backgroundColor=#FF x=10 y=10 width=226 height=344 id=canchaDelantera dragEnter=dragEnterHandler(event); / /mx:Panel /mx:Box !--mx:VBox mx:Image source=imagenes/foto.JPG/ mx:Label text=nombre/ mx:Label text=posicion / mx:Label text=potencia / /mx:VBox-- !-- perfil -- /mx:Application Thanks in advance. -- Fernando Wermus. www.linkedin.com/in/fernandowermus http://mientretiempo.blogspot.com/
[flexcoders] Drag and drop from datagrid to tree
Hi there Im hoping someone here can help me. I have encountered an obstacle in the project I am working on at the minute. I currently have a datagrid which is populated by an array collection of VOs. I want to be able to drag a column from the datagrid into a leaf node of a tree. When the drag is complete I want to pass an integer from the VO along with the id of the node which I am dropping the VO on into an event. My Problem is I cant seem to get the DragDrop event to fire! I've got the DragEnter and DragOver Events working but i can seem to get the tree to respond to or be receptive to my VO. Has anyone got any advice? Maybe a link to a good tutorial. I have looked myself but couldn't find one that would help me. All help will be much appreciated. Dave
RE: [flexcoders] Drag and drop from datagrid to tree
You'll need custom code. Google or check the forum archives From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of joyfulrodger Sent: Wednesday, July 16, 2008 12:06 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag and drop from datagrid to tree Hi there Im hoping someone here can help me. I have encountered an obstacle in the project I am working on at the minute. I currently have a datagrid which is populated by an array collection of VOs. I want to be able to drag a column from the datagrid into a leaf node of a tree. When the drag is complete I want to pass an integer from the VO along with the id of the node which I am dropping the VO on into an event. My Problem is I cant seem to get the DragDrop event to fire! I've got the DragEnter and DragOver Events working but i can seem to get the tree to respond to or be receptive to my VO. Has anyone got any advice? Maybe a link to a good tutorial. I have looked myself but couldn't find one that would help me. All help will be much appreciated. Dave
[flexcoders] Drag-n-Drop problem in DataGrid with custom ItemRenderer ...
Hi, I am trying to use a DataGrid to set the ordering of a group of images. I want to do this with a DataGrid which will show me some properties of the images in different columns including a thumbnail of the image. The problem is when I use any custom renderer for any column, the draging is not working. It works fine when I don't use any ItemRenderer. My code looks something like this: mx:DataGrid dragEnabled=true dropEnabled=true dragMoveEnabled=true mx:columns mx:DataGridColumn headerText=Thumb itemRenderer=component.GridImageRenderer / mx:DataGridColumn headerText=Current name width=100 itemRenderer=component.NameRenderer/ mx:DataGridColumn headerText=New name width=150 dataField=nameNew/ /mx:columns /mx:DataGrid Can anyone please give me any clue how to fix this? Regards, ~ Arif
RE: [flexcoders] Drag-n-Drop problem in DataGrid with custom ItemRenderer ...
If the renderer is causing problem, you should probably show the renderer code. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Muhammad Ariful Islam Sent: Thursday, July 03, 2008 1:37 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag-n-Drop problem in DataGrid with custom ItemRenderer ... Hi, I am trying to use a DataGrid to set the ordering of a group of images. I want to do this with a DataGrid which will show me some properties of the images in different columns including a thumbnail of the image. The problem is when I use any custom renderer for any column, the draging is not working. It works fine when I don't use any ItemRenderer. My code looks something like this: mx:DataGrid dragEnabled=true dropEnabled=true dragMoveEnabled=true mx:columns mx:DataGridColumn headerText=Thumb itemRenderer=component.GridImageRenderer / mx:DataGridColumn headerText=Current name width=100 itemRenderer=component.NameRenderer/ mx:DataGridColumn headerText=New name width=150 dataField=nameNew/ /mx:columns /mx:DataGrid Can anyone please give me any clue how to fix this? Regards, ~ Arif
Re: [flexcoders] Drag and Drop (modify default dragProxy)
Thanks Alex, I tried to follow the Flex classes to see what was happening (although I couldn't access DragManagerImpl or IDragManager). Looks as if dragImage is an instance of DataGridDragProxy, so I created my own subclass (which does nothing but create and populate a Label for the moment) and I also called preventDefault() as suggested. I don't see the label, and also as soon as doDrag() has been called I get the red circle icon, indicating that I can no longer drag and drop items within the grid (my DataGrid is set up so that dragEnabled and dropEnabled are both true). If it helps here is the code: private function onDragStart(event:DragEvent):void { event.preventDefault(); var dragInitiator:IUIComponent = event.dragInitiator; var dragSource:DragSource = new DragSource(); dragSource.addData(abcdefg, text); //created a subclass which overrides createChildren and creates/populates/adds a Label var dragImage:DataGridDragProxy = new MyDataGridDragProxy(); DragManager.doDrag(dragInitiator,dragSource, event, dragImage); } Cheers, Neil On Mon, May 12, 2008 at 6:30 PM, Alex Harui [EMAIL PROTECTED] wrote: It isn't the DragProxy you want to change, but probably just the dragImage handed into DragManager.doDrag. The place to do that is in a handler for DRAG_START where you call preventDefault() so the default dragImage isn't used. You can also subclass and override dragImage. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *nwebb *Sent:* Monday, May 12, 2008 7:04 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Drag and Drop (modify default dragProxy) Hi Douglas, thanks for the reply - yeah that's pretty much what I have at the moment (I capture the data on MouseDown and create/display a Label on MouseMove), but I thought it could be a little cleaner and so I was hoping I could access the current dragProxy, use the existing data within it, all within the MouseMove method. This is what I currently have: //Capture the row data when the user clicks on an item... private function dropZoneMouseDown(event:MouseEvent):void { var selectedData:XML = DataGrid(event.currentTarget).selectedItem as XML; _lastSelectedName = [EMAIL PROTECTED]; _lastSelectedAge = [EMAIL PROTECTED]; } private function dropZoneMouseMove(event:MouseEvent):void { var dragInitiator:IUIComponent = event.target as IUIComponent; var dragSource:DragSource = new DragSource(); var dragProxy:Label = _dragLabel; dragProxy.text = _lastSelectedName ++ _lastSelectedAge; DragManager.doDrag(dragInitiator, dragSource, event, dragProxy); } Cheers, Neil On Mon, May 12, 2008 at 2:41 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: perhaps you can create a Label with the text from these twocolumns and then use this method http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768 DK On Mon, May 12, 2008 at 8:40 AM, nwebb [EMAIL PROTECTED] wrote: Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Drag and Drop (modify default dragProxy)
Thanks Daniel, trying that now I seem to be having some problems getting anything to show up in my DataGridDragProxy subclass but I'm sure I'll work out the issue soon enough. Much appreciated. On Mon, May 12, 2008 at 3:37 PM, Daniel Gold [EMAIL PROTECTED] wrote: I think if you wanted to modify the default drag proxy you could subclass DataGrid and override the get dragImage function, which looks like this (in Flex 2.01) override protected function get dragImage():IUIComponent { var image:DataGridDragProxy = new DataGridDragProxy(); image.owner = this; return image; } You could subclass the DataGridDragProxy and then add your labels or whatever else you wanted, and return a new instance of that class in get dragImage On Mon, May 12, 2008 at 9:04 AM, nwebb [EMAIL PROTECTED] wrote: Hi Douglas, thanks for the reply - yeah that's pretty much what I have at the moment (I capture the data on MouseDown and create/display a Label on MouseMove), but I thought it could be a little cleaner and so I was hoping I could access the current dragProxy, use the existing data within it, all within the MouseMove method. This is what I currently have: //Capture the row data when the user clicks on an item... private function dropZoneMouseDown(event:MouseEvent):void { var selectedData:XML = DataGrid(event.currentTarget).selectedItem as XML; _lastSelectedName = [EMAIL PROTECTED]; _lastSelectedAge = [EMAIL PROTECTED]; } private function dropZoneMouseMove(event:MouseEvent):void { var dragInitiator:IUIComponent = event.target as IUIComponent; var dragSource:DragSource = new DragSource(); var dragProxy:Label = _dragLabel; dragProxy.text = _lastSelectedName ++ _lastSelectedAge; DragManager.doDrag(dragInitiator, dragSource, event, dragProxy); } Cheers, Neil On Mon, May 12, 2008 at 2:41 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: perhaps you can create a Label with the text from these twocolumns and then use this method http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768 DK On Mon, May 12, 2008 at 8:40 AM, nwebb [EMAIL PROTECTED] wrote: Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
[flexcoders] Drag and Drop (modify default dragProxy)
Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it?
Re: [flexcoders] Drag and Drop (modify default dragProxy)
perhaps you can create a Label with the text from these twocolumns and then use this method http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768 DK On Mon, May 12, 2008 at 8:40 AM, nwebb [EMAIL PROTECTED] wrote: Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Drag and Drop (modify default dragProxy)
Hi Douglas, thanks for the reply - yeah that's pretty much what I have at the moment (I capture the data on MouseDown and create/display a Label on MouseMove), but I thought it could be a little cleaner and so I was hoping I could access the current dragProxy, use the existing data within it, all within the MouseMove method. This is what I currently have: //Capture the row data when the user clicks on an item... private function dropZoneMouseDown(event:MouseEvent):void { var selectedData:XML = DataGrid(event.currentTarget).selectedItem as XML; _lastSelectedName = [EMAIL PROTECTED]; _lastSelectedAge = [EMAIL PROTECTED]; } private function dropZoneMouseMove(event:MouseEvent):void { var dragInitiator:IUIComponent = event.target as IUIComponent; var dragSource:DragSource = new DragSource(); var dragProxy:Label = _dragLabel; dragProxy.text = _lastSelectedName ++ _lastSelectedAge; DragManager.doDrag(dragInitiator, dragSource, event, dragProxy); } Cheers, Neil On Mon, May 12, 2008 at 2:41 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: perhaps you can create a Label with the text from these twocolumns and then use this method http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768 DK On Mon, May 12, 2008 at 8:40 AM, nwebb [EMAIL PROTECTED] wrote: Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Drag and Drop (modify default dragProxy)
I think if you wanted to modify the default drag proxy you could subclass DataGrid and override the get dragImage function, which looks like this (in Flex 2.01) override protected function get dragImage():IUIComponent { var image:DataGridDragProxy = new DataGridDragProxy(); image.owner = this; return image; } You could subclass the DataGridDragProxy and then add your labels or whatever else you wanted, and return a new instance of that class in get dragImage On Mon, May 12, 2008 at 9:04 AM, nwebb [EMAIL PROTECTED] wrote: Hi Douglas, thanks for the reply - yeah that's pretty much what I have at the moment (I capture the data on MouseDown and create/display a Label on MouseMove), but I thought it could be a little cleaner and so I was hoping I could access the current dragProxy, use the existing data within it, all within the MouseMove method. This is what I currently have: //Capture the row data when the user clicks on an item... private function dropZoneMouseDown(event:MouseEvent):void { var selectedData:XML = DataGrid(event.currentTarget).selectedItem as XML; _lastSelectedName = [EMAIL PROTECTED]; _lastSelectedAge = [EMAIL PROTECTED]; } private function dropZoneMouseMove(event:MouseEvent):void { var dragInitiator:IUIComponent = event.target as IUIComponent; var dragSource:DragSource = new DragSource(); var dragProxy:Label = _dragLabel; dragProxy.text = _lastSelectedName ++ _lastSelectedAge; DragManager.doDrag(dragInitiator, dragSource, event, dragProxy); } Cheers, Neil On Mon, May 12, 2008 at 2:41 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: perhaps you can create a Label with the text from these twocolumns and then use this method http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768 DK On Mon, May 12, 2008 at 8:40 AM, nwebb [EMAIL PROTECTED] wrote: Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
[flexcoders] Drag and Drop with data grids
Hi I am VERY new to Flex. What I am trying to do is Drag an item from a data grid and if a flag is Yes then I need to have that item being dragged to be dropped on two data grids rather than just one data grid. Is there any way to do this? I need to to append to what is already in the data grids it is being dropped on.
RE: [flexcoders] Drag and Drop with data grids
Override the dragDrop handler. You can do whatever you want with the data in there. http://livedocs.adobe.com/flex/3/html/dragdrop_5.html Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of beczim Sent: Monday, May 12, 2008 10:45 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag and Drop with data grids Hi I am VERY new to Flex. What I am trying to do is Drag an item from a data grid and if a flag is Yes then I need to have that item being dragged to be dropped on two data grids rather than just one data grid. Is there any way to do this? I need to to append to what is already in the data grids it is being dropped on.
RE: [flexcoders] Drag and Drop (modify default dragProxy)
It isn't the DragProxy you want to change, but probably just the dragImage handed into DragManager.doDrag. The place to do that is in a handler for DRAG_START where you call preventDefault() so the default dragImage isn't used. You can also subclass and override dragImage. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nwebb Sent: Monday, May 12, 2008 7:04 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Drag and Drop (modify default dragProxy) Hi Douglas, thanks for the reply - yeah that's pretty much what I have at the moment (I capture the data on MouseDown and create/display a Label on MouseMove), but I thought it could be a little cleaner and so I was hoping I could access the current dragProxy, use the existing data within it, all within the MouseMove method. This is what I currently have: //Capture the row data when the user clicks on an item... private function dropZoneMouseDown(event:MouseEvent):void { var selectedData:XML = DataGrid(event.currentTarget).selectedItem as XML; _lastSelectedName = [EMAIL PROTECTED]; _lastSelectedAge = [EMAIL PROTECTED]; } private function dropZoneMouseMove(event:MouseEvent):void { var dragInitiator:IUIComponent = event.target as IUIComponent; var dragSource:DragSource = new DragSource(); var dragProxy:Label = _dragLabel; dragProxy.text = _lastSelectedName ++ _lastSelectedAge; DragManager.doDrag(dragInitiator, dragSource, event, dragProxy); } Cheers, Neil On Mon, May 12, 2008 at 2:41 PM, Douglas Knudsen [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: perhaps you can create a Label with the text from these twocolumns and then use this method http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768 http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768 DK On Mon, May 12, 2008 at 8:40 AM, nwebb [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it? -- Douglas Knudsen http://www.cubicleman.com http://www.cubicleman.com this is my signature, like it?
[flexcoders] Drag and Drop question
If i'm dragging an element from one tree to another. How do i get the updated xml of the tree i'm dragging off? For instance TREE 1 - Element 1 - Element 2 TREE 2 if i get the xml from tree 1 it would be something like root element label=Element 1 / element label=Element 2 / /root but if i drag the Element 1 into the TREE 2 i want to get the xml without the Element 1, without that node. i'm trying to get it creating a handler for dragDrop attribute on the Tree 2, but everytime i get it the items are not updated. Anyone know how to get the updated xml that tree 1 will have after i drop the element? Please... this is killing me =/ Thanks
Re: [flexcoders] Drag and Drop question
I'm fairly certain that there's no voodoo to automatically delete nodes from your XML, you need to do that yourself in your drop handler. -J On Thu, May 1, 2008 at 4:36 PM, Rafael Faria [EMAIL PROTECTED] wrote: If i'm dragging an element from one tree to another. How do i get the updated xml of the tree i'm dragging off? For instance TREE 1 - Element 1 - Element 2 TREE 2 if i get the xml from tree 1 it would be something like root element label=Element 1 / element label=Element 2 / /root but if i drag the Element 1 into the TREE 2 i want to get the xml without the Element 1, without that node. i'm trying to get it creating a handler for dragDrop attribute on the Tree 2, but everytime i get it the items are not updated. Anyone know how to get the updated xml that tree 1 will have after i drop the element? Please... this is killing me =/ Thanks -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] Drag and Drop question
Actually I am pretty sure the list-based component's built-in drag/drop functionality does do this on a MOVE. The docs describe this. Are the XML structures the same? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Thursday, May 01, 2008 2:46 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Drag and Drop question I'm fairly certain that there's no voodoo to automatically delete nodes from your XML, you need to do that yourself in your drop handler. -J On Thu, May 1, 2008 at 4:36 PM, Rafael Faria [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: If i'm dragging an element from one tree to another. How do i get the updated xml of the tree i'm dragging off? For instance TREE 1 - Element 1 - Element 2 TREE 2 if i get the xml from tree 1 it would be something like root element label=Element 1 / element label=Element 2 / /root but if i drag the Element 1 into the TREE 2 i want to get the xml without the Element 1, without that node. i'm trying to get it creating a handler for dragDrop attribute on the Tree 2, but everytime i get it the items are not updated. Anyone know how to get the updated xml that tree 1 will have after i drop the element? Please... this is killing me =/ Thanks -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Re: [flexcoders] Drag and Drop question
How do you mark a drag/drop operation as having a certain type (ie Move)? -J On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt [EMAIL PROTECTED] wrote: Actually I am pretty sure the list-based component's built-in drag/drop functionality does do this on a MOVE. The docs describe this. Are the XML structures the same? Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Thursday, May 01, 2008 2:46 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Drag and Drop question I'm fairly certain that there's no voodoo to automatically delete nodes from your XML, you need to do that yourself in your drop handler. -J On Thu, May 1, 2008 at 4:36 PM, Rafael Faria [EMAIL PROTECTED] wrote: If i'm dragging an element from one tree to another. How do i get the updated xml of the tree i'm dragging off? For instance TREE 1 - Element 1 - Element 2 TREE 2 if i get the xml from tree 1 it would be something like root element label=Element 1 / element label=Element 2 / /root but if i drag the Element 1 into the TREE 2 i want to get the xml without the Element 1, without that node. i'm trying to get it creating a handler for dragDrop attribute on the Tree 2, but everytime i get it the items are not updated. Anyone know how to get the updated xml that tree 1 will have after i drop the element? Please... this is killing me =/ Thanks -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] Drag and Drop question
Move is the default, there is extra work to copy. http://livedocs.adobe.com/flex/3/html/dragdrop_8.html Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Thursday, May 01, 2008 5:05 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Drag and Drop question How do you mark a drag/drop operation as having a certain type (ie Move)? -J On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Actually I am pretty sure the list-based component's built-in drag/drop functionality does do this on a MOVE. The docs describe this. Are the XML structures the same? Tracy From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ] On Behalf Of Josh McDonald Sent: Thursday, May 01, 2008 2:46 AM To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com Subject: Re: [flexcoders] Drag and Drop question I'm fairly certain that there's no voodoo to automatically delete nodes from your XML, you need to do that yourself in your drop handler. -J On Thu, May 1, 2008 at 4:36 PM, Rafael Faria [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: If i'm dragging an element from one tree to another. How do i get the updated xml of the tree i'm dragging off? For instance TREE 1 - Element 1 - Element 2 TREE 2 if i get the xml from tree 1 it would be something like root element label=Element 1 / element label=Element 2 / /root but if i drag the Element 1 into the TREE 2 i want to get the xml without the Element 1, without that node. i'm trying to get it creating a handler for dragDrop attribute on the Tree 2, but everytime i get it the items are not updated. Anyone know how to get the updated xml that tree 1 will have after i drop the element? Please... this is killing me =/ Thanks -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Re: [flexcoders] Drag and Drop question
Ew =) All my dragdrop stuff is funky custom components so I never noticed. But ew. -J On Fri, May 2, 2008 at 7:49 AM, Tracy Spratt [EMAIL PROTECTED] wrote: Move is the default, there is extra work to copy. http://livedocs.adobe.com/flex/3/html/dragdrop_8.html Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Thursday, May 01, 2008 5:05 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Drag and Drop question How do you mark a drag/drop operation as having a certain type (ie Move)? -J On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt [EMAIL PROTECTED] wrote: Actually I am pretty sure the list-based component's built-in drag/drop functionality does do this on a MOVE. The docs describe this. Are the XML structures the same? Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Thursday, May 01, 2008 2:46 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Drag and Drop question I'm fairly certain that there's no voodoo to automatically delete nodes from your XML, you need to do that yourself in your drop handler. -J On Thu, May 1, 2008 at 4:36 PM, Rafael Faria [EMAIL PROTECTED] wrote: If i'm dragging an element from one tree to another. How do i get the updated xml of the tree i'm dragging off? For instance TREE 1 - Element 1 - Element 2 TREE 2 if i get the xml from tree 1 it would be something like root element label=Element 1 / element label=Element 2 / /root but if i drag the Element 1 into the TREE 2 i want to get the xml without the Element 1, without that node. i'm trying to get it creating a handler for dragDrop attribute on the Tree 2, but everytime i get it the items are not updated. Anyone know how to get the updated xml that tree 1 will have after i drop the element? Please... this is killing me =/ Thanks -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
[flexcoders] drag and drop canvas
Hello all , i am facing a problem that i want to drag and drop a custom canvas from a canvas to other . I also want to make proxyimage of that canvas then drop it into another canvas . I have done it for image but unable to do it for canvas . Please help me ?
AW: [flexcoders] drag and drop a button?
Hi Winscot, I found an alternative way to get a proxy image for the DragManager // FANCY: // --- // Add a proxy image here for drag manager to use if you would like! var proxy:UIComponent = UIComponent( event.currentTarget ); // Copy the contents of the control (a la bitmap data) var bitmapData:BitmapData = new BitmapData( proxy.width, proxy.height ); bitmapData.draw( proxy ); // Let the drag manager take care of the rest - with a visual indicator of what its dragging... DragManager.doDrag( dragChild, dragSource, event, new BitmapAsset(bitmapData) ); Harald Von: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Rick Winscot Gesendet: Samstag, 12. April 2008 03:05 An: flexcoders@yahoogroups.com Betreff: RE: [flexcoders] drag and drop a button? Take a look at this sample - BitmapData is used to create a proxy on the fly of the object being dragged. http://www.quilix.com/node/3 Rick Winscot From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of grimmwerks Sent: Friday, April 11, 2008 10:23 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] drag and drop a button? Is there a simple tutorial for it? I don't really want to have an image proxy - I want to really drag a button somwhere else on the canvas. Simple.
RE: [flexcoders] drag and drop a button?
You bet! There are quite a few 'short hand' methods to do things... but you'll want to be careful with how you use contructors/object casting inside calls. If BitmapData were somehow to end up null. subsequent operations on a null object leads to runtime errors. In this case BitmapAsset can take null as an argument but will still return an 'empty' bitmap - so no big. Also - while 'short hand' approaches appear 'smaller' the statements true meaning (number of operations) will always be interpreted by the compiler and VM and not by how many constructors you can nest in a single line. Here the real savings is in minimizing object overhead. Image is derived from SWFLoader and BitmapAsset is derived from Bitmap. BitmapAsset is 'slimmer.' Rick Winscot From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Harald Dehn Sent: Saturday, April 12, 2008 9:38 AM To: flexcoders@yahoogroups.com Subject: AW: [flexcoders] drag and drop a button? Hi Winscot, I found an alternative way to get a proxy image for the DragManager // FANCY: // --- // Add a proxy image here for drag manager to use if you would like! var proxy:UIComponent = UIComponent( event.currentTarget ); // Copy the contents of the control (a la bitmap data) var bitmapData:BitmapData = new BitmapData( proxy.width, proxy.height ); bitmapData.draw( proxy ); // Let the drag manager take care of the rest - with a visual indicator of what its dragging... DragManager.doDrag( dragChild, dragSource, event, new BitmapAsset(bitmapData) ); Harald Von: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Rick Winscot Gesendet: Samstag, 12. April 2008 03:05 An: flexcoders@yahoogroups.com Betreff: RE: [flexcoders] drag and drop a button? Take a look at this sample - BitmapData is used to create a proxy on the fly of the object being dragged. http://www.quilix.com/node/3 Rick Winscot From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of grimmwerks Sent: Friday, April 11, 2008 10:23 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] drag and drop a button? Is there a simple tutorial for it? I don't really want to have an image proxy - I want to really drag a button somwhere else on the canvas. Simple. image001.jpgimage002.jpg
[flexcoders] drag and drop a button?
Is there a simple tutorial for it? I don't really want to have an image proxy - I want to really drag a button somwhere else on the canvas. Simple.
RE: [flexcoders] drag and drop a button?
Take a look at this sample - BitmapData is used to create a proxy on the fly of the object being dragged. http://www.quilix.com/node/3 Rick Winscot From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of grimmwerks Sent: Friday, April 11, 2008 10:23 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] drag and drop a button? Is there a simple tutorial for it? I don't really want to have an image proxy - I want to really drag a button somwhere else on the canvas. Simple. image001.jpgimage002.jpg
[flexcoders] Drag and Drop for Variable Custom Component
Hi. I've read the documentation about drag and drop and I've read up on custom components, but my case is a little different. I'm never directly invoking my custom component, but rather conditionally invoking it (if a condition is true). So I don't write the tags for the component, I'm just adding it as a child to a Canvas component to make it show up. I feel like this complicates drag and drop support, but I want to see what you guys think about it before I go over my head. Here's the link to the page with the application in question: http://75.125.60.10/~bingbuil/feature2.php I'm working on the details like overlapping classes, but I scrapped this together quickly to test out the Canvas children thing. So my question basically is how would I implement Drag and Drop on the oval elements that get appended to the Canvases? I've messed around with the component itself, but I can't figure out how to have it communicate with the main MXML application, to tell it to call a function. If the source code would help, I'd be glad to provide it. Thanks.
Re: [flexcoders] drag and drop between list - changing default behavior to allow dropping into list item.
Thanks Alex, Actually,that's exactly the answer I was afraid off.. when looking at the said code, I have a feeling, -since I'm using custom itemrenderrer in my list- it might be simpler to dispatch mouse over events from there. Am I wrong ? On Fri, Mar 14, 2008 at 3:04 AM, Alex Harui [EMAIL PROTECTED] wrote: Tree has drop into folder code. Is that what you're looking for? -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Thibaud Van Vreckem *Sent:* Thursday, March 13, 2008 10:59 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] drag and drop between list - changing default behavior to allow dropping into list item. Here we go again... sorry message was sent unfinished by mistake.. I Have 2 List: list1 contains *folders. *list2 contains *files *they are both drag and drop enabled: dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=dragEnterHandler(event) * *I'm keeping the default dnd behavior for reordering only *within *each list. private function dragEnterHandler(event:DragEvent):void { if (event.dragInitiator != event.currentTarget) { event.preventDefault(); } } * *Now How should I go about enabling my files items from list2 to be dropped *over *the folder items in list1 (instead of being inserted in the list rows). is there an easy way to detect which item in the list I am rolling over without resorting to some fancy coordinate position detection ? Thanks.
RE: [flexcoders] drag and drop between list - changing default behavior to allow dropping into list item.
The Tree code is extra complex as it handles parent/child relationships. Yours can be simpler. I suppose you could turn off dropEnabled on the List and have each renderer be a dropTarget. Should work, but I don't recall ever seeing a complete solution. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Thibaud Van Vreckem Sent: Friday, March 14, 2008 2:18 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] drag and drop between list - changing default behavior to allow dropping into list item. Thanks Alex, Actually,that's exactly the answer I was afraid off.. when looking at the said code, I have a feeling, -since I'm using custom itemrenderrer in my list- it might be simpler to dispatch mouse over events from there. Am I wrong ? On Fri, Mar 14, 2008 at 3:04 AM, Alex Harui [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Tree has drop into folder code. Is that what you're looking for? From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ] On Behalf Of Thibaud Van Vreckem Sent: Thursday, March 13, 2008 10:59 AM To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com Subject: [flexcoders] drag and drop between list - changing default behavior to allow dropping into list item. Here we go again... sorry message was sent unfinished by mistake.. I Have 2 List: list1 contains folders. list2 contains files they are both drag and drop enabled: dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=dragEnterHandler(event) I'm keeping the default dnd behavior for reordering only within each list. private function dragEnterHandler(event:DragEvent):void { if (event.dragInitiator != event.currentTarget) { event.preventDefault(); } } Now How should I go about enabling my files items from list2 to be dropped over the folder items in list1 (instead of being inserted in the list rows). is there an easy way to detect which item in the list I am rolling over without resorting to some fancy coordinate position detection ? Thanks.
[flexcoders] drag and drop between list - changing default behavior to allow dropping into list item.
Hello, I Have 2 List: list1 contains *folders. *list2 contains *files *they are both drag and drop enabled: dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=dragEnterHandler(event) * *I'm keeping the default dnd behavior for reordering within each list. private function dragEnterHandler(event:DragEvent):void { if (event.dragInitiator != event.currentTarget) { // Explicitly handle the dragDrop event. event.preventDefault(); } } * *
RE: [flexcoders] drag and drop between list - changing default behavior to allow dropping into list item.
Sounds like you want calculateDropIndex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Thibaud Van Vreckem Sent: Thursday, March 13, 2008 10:59 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] drag and drop between list - changing default behavior to allow dropping into list item. Here we go again... sorry message was sent unfinished by mistake.. I Have 2 List: list1 contains folders. list2 contains files they are both drag and drop enabled: dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=dragEnterHandler(event) I'm keeping the default dnd behavior for reordering only within each list. private function dragEnterHandler(event:DragEvent):void { if (event.dragInitiator != event.currentTarget) { event.preventDefault(); } } Now How should I go about enabling my files items from list2 to be dropped over the folder items in list1 (instead of being inserted in the list rows). is there an easy way to detect which item in the list I am rolling over without resorting to some fancy coordinate position detection ? Thanks.
RE: [flexcoders] drag and drop between list - changing default behavior to allow dropping into list item.
Tree has drop into folder code. Is that what you're looking for? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Thibaud Van Vreckem Sent: Thursday, March 13, 2008 10:59 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] drag and drop between list - changing default behavior to allow dropping into list item. Here we go again... sorry message was sent unfinished by mistake.. I Have 2 List: list1 contains folders. list2 contains files they are both drag and drop enabled: dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=dragEnterHandler(event) I'm keeping the default dnd behavior for reordering only within each list. private function dragEnterHandler(event:DragEvent):void { if (event.dragInitiator != event.currentTarget) { event.preventDefault(); } } Now How should I go about enabling my files items from list2 to be dropped over the folder items in list1 (instead of being inserted in the list rows). is there an easy way to detect which item in the list I am rolling over without resorting to some fancy coordinate position detection ? Thanks.
[flexcoders] Drag Move Drop help needed with NESTED list items...
hi everyone, this is making me contemplating switching fields to carpentry. here's the gist of it: I'm trying to build a 'libray' of sorts that have folders of items... basically the idea is to have folders that can have subfolders too. here's the xml http://distance.jhsph.edu/bau/flex/dragDrop/data/data.xml to compound complexity; I'm trying to make the 'drag and drop' reordering of items based on a button press (will skin everything later.) so that when the user mouses down the button it broadcasts an event making all the lists drag/drop able. something is going wonky... its not moving the items, but rather, copying them. if anyone has insight to this, it'd be much appreciated here's the url: I have the file source enabled: http://distance.jhsph.edu/bau/flex/dragDrop/index.html I'm losing hair!
[flexcoders] Drag and Drop between NativeWindows
Does anybody have any examples of being able to drag from one native window to another? I've tried both the DragManager and the Native Drand and Drop functionality, but neither seem to work for this case. Whenever my dragging leaves the window, it cancals the drag.
Re: [flexcoders] Drag and Drop to Nowhere
I'm pretty sure the x icon image is set as a style on the dragproxy, so you should be able to get away with just assigning a custom style name and setting up your trashcan icon in your css. -J On Fri, Feb 22, 2008 at 7:11 AM, Jim Cook [EMAIL PROTECTED] wrote: Can someone give me a pointer on how to begin this? Imagine a shopping cart that contains images of items. I want to allow users to drag items out of the shopping cart and when they drop them, the items are removed. Detecting DRAG_COMPLETE and removing the items is not my problem. My problem is giving the user feedback that they can drop the item they are dragging _outside_ of the shopping cart. Default behavior shows a red x on my DragProxy no matter where it goes. I would like the DragProxy to display a trashcan image when the user leaves the shopping cart no matter what object they are dragging over. I suppose the problem is all the other components are saying no during the DRAG_ENTER event. Maybe I have to fake the whole drag/drop concept to pull this off? -- jim -- Therefore, send not to know For whom the bell tolls, It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
[flexcoders] Drag and Drop to Nowhere
Can someone give me a pointer on how to begin this? Imagine a shopping cart that contains images of items. I want to allow users to drag items out of the shopping cart and when they drop them, the items are removed. Detecting DRAG_COMPLETE and removing the items is not my problem. My problem is giving the user feedback that they can drop the item they are dragging _outside_ of the shopping cart. Default behavior shows a red x on my DragProxy no matter where it goes. I would like the DragProxy to display a trashcan image when the user leaves the shopping cart no matter what object they are dragging over. I suppose the problem is all the other components are saying no during the DRAG_ENTER event. Maybe I have to fake the whole drag/drop concept to pull this off? -- jim
[flexcoders] Drag n Drop Tile List to Canvas
Hi Folks, Can any one please help me to drag and drop of tile list images to Canvas -- Thanks Regards Swaminathan. M
Re: [flexcoders] Drag n Drop Tile List to Canvas
there is an example of that in flex Documentation - Original Message From: Swamy Nathan [EMAIL PROTECTED] To: [EMAIL PROTECTED]; flexcoders@yahoogroups.com Sent: Thursday, February 21, 2008 10:34:03 PM Subject: [flexcoders] Drag n Drop Tile List to Canvas Hi Folks, Can any one please help me to drag and drop of tile list images to Canvas -- Thanks Regards Swaminathan. M Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
[flexcoders] Drag and Drop issues
I've got an application I'm working on where I need to be able to drag things onto a Canvas, and sometimes into containers that are children of the canvas. The problem I'm having is that when I have another container inside the canvas, it doesn't register the dragEnter event, even though I have added an event listener for that event to the component. Instead, only it's parent dispatches the dragEnter event. How can I get the child components to register when the user drags over them, versus the parent canvas?
RE: [flexcoders] Drag and Drop issues
Maybe you shouldn't register the canvas. Put another child in the canvas with alpha=0 that goes behind all the other children and register that. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Nick Collins Sent: Wednesday, February 20, 2008 11:14 AM To: flexcoders Subject: [flexcoders] Drag and Drop issues I've got an application I'm working on where I need to be able to drag things onto a Canvas, and sometimes into containers that are children of the canvas. The problem I'm having is that when I have another container inside the canvas, it doesn't register the dragEnter event, even though I have added an event listener for that event to the component. Instead, only it's parent dispatches the dragEnter event. How can I get the child components to register when the user drags over them, versus the parent canvas?
[flexcoders] Drag and drop into a datagrid Cell (rather than the default, row) ?
Sorry to ask a basic question, but the docs, google, and searchcoders don't seem to be getting me any results so far (or my search terms are just rubbish) I'd like to be able to drag an item to a *cell* in a datagrid, the default action would seem to be that the drop adds a new row, whereas I desire the information to go into an existing cell. I have a feeling that I need to make a custom renderer for that column, and enable the drag and drop on that rather than the datagrid. Could anyone confirm/deny, offer basic guidance/direction (I'll work out the details) or even better know of an online example? Many thanks in advance, Jim. __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __
RE: [flexcoders] Drag and drop into a datagrid Cell (rather than the default, row) ?
Enable drop on a row might work. I might just try handling the drop and the showDropFeedback differently. Instead of the single line, you should be able to highlight a cell and then instead of an insert to the collection, change some data in a cell. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jim Hayes Sent: Thursday, February 14, 2008 6:33 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag and drop into a datagrid Cell (rather than the default, row) ? Sorry to ask a basic question, but the docs, google, and searchcoders don't seem to be getting me any results so far (or my search terms are just rubbish) I'd like to be able to drag an item to a *cell* in a datagrid, the default action would seem to be that the drop adds a new row, whereas I desire the information to go into an existing cell. I have a feeling that I need to make a custom renderer for that column, and enable the drag and drop on that rather than the datagrid. Could anyone confirm/deny, offer basic guidance/direction (I'll work out the details) or even better know of an online example? Many thanks in advance, Jim. __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __
RE: [flexcoders] Drag and drop into a datagrid Cell (rather than the default, row) ?
Many thanks Alex, in fact my original thoughts worked quite well (plenty of hassle due to not knowing drag and drop at all, or data binding quite as well as I'd thought though! g ), but I had considered that way of doing things. If anyone finds this on a future search, then making a custom renderer (for the column in which you want to drag something into an existing cell) and making that a drop target does work fine (as I'd expected, just didn't have a clue as to how to actually do it). Ta for your thoughts, much appreciated. -Original Message- From: flexcoders@yahoogroups.com on behalf of Alex Harui Sent: Thu 14/02/2008 18:57 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Drag and drop into a datagrid Cell (rather than the default, row) ? Enable drop on a row might work. I might just try handling the drop and the showDropFeedback differently. Instead of the single line, you should be able to highlight a cell and then instead of an insert to the collection, change some data in a cell. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jim Hayes Sent: Thursday, February 14, 2008 6:33 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag and drop into a datagrid Cell (rather than the default, row) ? Sorry to ask a basic question, but the docs, google, and searchcoders don't seem to be getting me any results so far (or my search terms are just rubbish) I'd like to be able to drag an item to a *cell* in a datagrid, the default action would seem to be that the drop adds a new row, whereas I desire the information to go into an existing cell. I have a feeling that I need to make a custom renderer for that column, and enable the drag and drop on that rather than the datagrid. Could anyone confirm/deny, offer basic guidance/direction (I'll work out the details) or even better know of an online example? Many thanks in advance, Jim. __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __ __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __winmail.dat
RE: [flexcoders] Drag And Drop Question: List within list...
Tree is buggy in Flex 2. If you can, get on the beta for Flex 3 and see if you still have problems there. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Boson Au Sent: Thursday, December 06, 2007 10:40 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag And Drop Question: List within list... Hi everyone, I'm a beginning Flex Developer, but I've had a couple of years experience w/ scripting. here's my problem: my current app basically deals with folders and files, such that a folder has files and a folder can have another folder (that has files or other folders... you get the idea) I'm populating this using a really simple xml list of nodes and children. I'm using a tree control with DnD enabled. I've been testing this and here's what's going on: 1.) I drag the files and folders around on the own 'level' and reorder them: all good. 2.) I drag a file from one folder and put them in another, this is where it gets weird. It either does not remove the original object being dragged from its previous list, or it disappears into the ether and I just straight up lose the object. can anyone help? I uploaded the test at http://www.americanforkliftsociety.com/flexStuff/xmlTest.html http://www.americanforkliftsociety.com/flexStuff/xmlTest.html (rt click to view source)...