Drag Drop Event

Hello All,
Can I trap the Drag and Drop event of a file from desktop through Scripting for Adobe Bridge.
Thank you all in advance.
Regards
Farzana.

I haven't seen such an event available to the scripts. I have an event handler and when I turned on my own logging to output all the events that I see, I didn't see any drag/drop events when I tried that operation. That doesn't mean there isn't someother way to do this, but it wasn't obvious to me through normal event handling.
--John

Similar Messages

  • Drag&Drop over JList, would like to highlight cell

    I have a JList and have it defined as a drop site. What I would like to do is when the user drags a file from windows to my JList I would like to know which cell they dropped it on. Is this possible?
    It would also be nice to have the cell that the drag object is currently over sighlight like it's being selected.
    Thank you!!!

    For second part, where you want the cell that the item is being dragged over to be highlited, you could implement a MouseListener, and use the mouseEntered method to test a boolean to see if there is a Drag&Drop event happining. If trur then change the backgound color. Then use mouseExited() to reset the color to normal.

  • How to drag and drop events across months while in month view?

    Is there a way to drag an event across months when the view is set to monthly view?  I know the events can be dragged and dropped across the days in the month on the screen, but how can I carry through the end of the month - there does not seem to be a way to move the screen view to the next month while the event is being dragged!

    Hi,
    You can do it with keyboard shortcuts.
    Select the event. Press Cmd+X. Press Cmd and right or left arrow (depending if it is forward or back in months) until you are in the correct month. Press Cmd+V to pase on the same day in the new month.
    Best wishes
    John M

  • ADF Drag and drop event inside the single af:treetable

    Hi Experts,
    I have a af:treeTable in my ADF web project and i would like to implement the drag and drop event to the same tree table for supporting my sample test project use case. Currently i am facing some issue to get the source tree node and the destination tree node of the drop and drop event inside my drop listener method. How can i get those object since i need to perform some business operation inside the listener. Please note that i am not using ADF BC4j in my project. The service layer is implemented as EJB and it's being called from the backing bean.
    Looking forward some guide lines to resolve this issue from you experts.
    Thank you.

    It's not a perfect solution, but a work in progress that i'm currently using in my backing bean:
    private RichTree navTree;
    private void exitContainers() {
    boolean success = false;
    while (!success) {
    try {
    navTree.exitContainer();
    } catch (Exception e) {
    success = true;
    private void clearDisclosedRowKeys() {
    if (navTree != null && navTree.getDisclosedRowKeys() != null) {
    RowKeySet rks = navTree.getDisclosedRowKeys();
    Iterator rksIter = rks.iterator();
    while (rksIter.hasNext()) {
    exitContainers();
    List<Integer> rowkey = (List<Integer>) rksIter.next();
    List<Integer> newRowkey = new ArrayList<Integer>();
    for (Integer row : rowkey) {
    if (navTree.isRowAvailable(row)) {
    navTree.setRowIndex(row);
    navTree.enterContainer();
    newRowkey.add(row);
    } else {
    // Row is no longer available
    break;
    if (newRowkey.size() == 0) {
    rks.remove(rowkey);
    } else {
    rowkey.clear();
    rowkey.addAll(newRowkey);
    Whenever you make a 'delete' or 'move' in the tree, call clearDisclosedRowKeys(), it will remove anything that's no longer valid, so your tree won't collapse, and you won't get the error anymore.
    I took out my logging and debug statements, but essentially this just gets all the rows, checks to see if they're valid, and if so creates a new RowKeySet with the valid rows in it.
    Of course make sure you have the setNavTree and getNavTree accessor's created and that they're bound in your JSFF, otherwise navTree will always be null.
    I haven't yet found a way to 'nicely' find out if you're at the top level container, so i'm relying on an Exception to occur to give me that information, if anyone knows a better solution please feel free to share it.

  • Listening to Drag and Drop event from the extension panel

    How is it possible to detect a drop event from a Layer to a text field in a panel developer using the SDK?
    Drag and drop operation between panel elements are not the issues, but drag and drop from Photoshop and the panel might be an issue.
    Is it possible to implement them?
    If yes, could I be redirected to the documentation topic or can someone post some code snippet ?
    Thanks

    What model of camcorder is your video from and what resolution is it?
    What operating system are you using? Have you ensured that you have the latest version of Quicktime, per the program's requirements?
    Do not convert your video. The program will best with video directly from a camcorder, and converting it may will turn it into a format that it may be LESS likely to work well with.

  • Drag & Drop kills Tree Change event

    I have a tree that I am dragging from to a HorizontalList.
    Anyway, I have the actual drag and drop working fine. However, my
    tree has a handler for it's change event so that when the selected
    item changes, a web service lookup is initiated. After the drag and
    drop the tree appears to have a different item selected, however
    the change event does not fire. Also if I manually click on the
    same row that already appears selected, the event fires and my
    lookup is kicked off.
    It's like after the drag drop the tree's selected item
    appears selected VISUALLY but the tree does not know it is the
    selected item.
    HELP PLEASE.
    P.S. - I am using Flex 2.01 by the way.

    The trick is not to use the tree drag* properties of the
    control and instead use the DragManager to do custom drag and drop.
    This allows to listen to mouse down events and evaluate
    whether to useDragManager.doDrag() to initiate a drag.

  • Triggering pop-up event through drag & drop?

    Hi everyone, I'm a newly registered member of this forum.
    I've roughly browsed though this forum to seek a solution for my problem, but I can't seem to find a suitable solution (perhaps i should continue looking).
    Scenario:
    Anyway, I'm facing some technical challenges in flex as I'm relatively new to it.
    I'm trying to create a web application, where users use drag & drop to input information.
    I visualize this process:
    User selects icon from a list
    User drags the icon onto target area
    User releases icon over target area
    Pop-up appears with a form for users to input information.
    Users input information and submits
    Information is stored in the database.
    Present knowledge:
    Because I'm new to Flex, I tried to break this down and learn by components:
    I'm able to:
    Create a drag & drop effect
    Create connection to database using HttpService
    Main Problem:
    I'm able to use the drag and drop functionality but I cannot trigger a pop-up event when the icon is dropped onto the target area.
    Sorry if the problem seems a little insignificant due to my lack in knowledge.
    I'm just a student trying to learn. Hope that someone can help me out here, or provide me with relevant links to learning resources.
    Thanks in advance,
    Jord

    Hi,
    thanks so much for replying, but I would really appreciate a little bit more help.
    I vaguely understand the concepts of DragEvent.DRAG_DROP, but I'm not really familiar with the syntax of how to cause allow a pop-up to appear.
    This is how my script look like:
    <mx:Script>
            <![CDATA[
                import mx.events.DragEvent;
                import mx.containers.Box;
                import mx.managers.DragManager;
                import mx.core.DragSource;
                import mx.collections.ArrayCollection;
                import mx.rpc.events.ResultEvent;
                [Embed("IconAssets/1.gif")]
                [Bindable]
                public var personalAsset:Class;
                [Embed("IconAssets/2.gif")]
                [Bindable]
                public var investment:Class;
                [Bindable]
                private var iconValue:uint;          
                private function iconDrag (event:MouseEvent, value:uint):void
                        var dragInitiator:Image = event.currentTarget as Image;
                        var dragSource:DragSource = new DragSource();
                        dragSource.addData(value, 'value');
                        var dragProxy:Image = new Image();
                        dragProxy.source = event.currentTarget.source;
                        DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
                private function dragOver(event:DragEvent):void
                        var dropTarget:Box=event.currentTarget as Box;
                        if (event.dragSource.hasFormat('value'))
                                dropTarget.setStyle("borderThickness", 5);
                                DragManager.acceptDragDrop(dropTarget);
                private function dragAway(event:DragEvent):void
                        var dropTarget:Box=event.currentTarget as Box;
                        revertTarget();             
                private function dragAccept(event:DragEvent):void
                        var value:uint = event.dragSource.dataForFormat('value') as uint;
                        The trigger for the Pop-up should be placed here.
                        revertTarget();
                private function revertTarget():void
                    fStatement.setStyle("borderThickness", 1);
            ]]>
        </mx:Script>
    I'm not sure whether I'm correct to state (in bold, italic, & underline) above that the event trigger for the pop-up should be within that particular function.
    The difficulty I'm facing now is that the (structure of the) popup should be written in MXML and yet I have to place them in the ActionScript.
    (I sense that I have a fundamental misconception of how this works,so please correct me to the best of your knowledge.)
    I would greatly appreciate it if anyone is able to provide me with an example/sample of how this should be done.
    With Thanks,
    Jord

  • Drag Drop List to List

    I have a source list and a destination list. I want to submit
    the contents of the destination list via my sendformdata function
    along with the other formitems.
    Here are my source/dest lists.
    <mx:VBox dropShadowEnabled="true">
    <mx:Label text="Available Loops"/>
    <mx:List id="srclist" width="300" height="150"
    allowMultipleSelection="true"
    dragEnabled="true" dropEnabled="true"
    dragMoveEnabled="true" labelField="category"
    dataTipFunction="myLabelFunc" showDataTips="true"
    alternatingItemColors="[#ece8ff, #ffffff]">
    </mx:List>
    </mx:VBox>
    <mx:VBox>
    <mx:Label text="Patched Loops"/>
    <mx:List alternatingItemColors="[#ece8ff, #ffffff]"
    id="destlist" width="200" height="150"
    allowMultipleSelection="true"
    dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"
    labelField="category"/>
    </mx:VBox>
    user drags one or more items from the source to dest list.
    This works great.
    Now I need to pass the dropped/selected data in destlist to
    myobj, along with the other form items. How?
    <mx:Script>
    <![CDATA[
    private function sendFormdata():void {
    var myobj:Object = new Object();
    myobj.name = myname.text;
    myobj.email = myemail.text;
    myobj.entry = myentry.text;
    myobj.entrycomment = myentrycomment.htmlText;
    myobj.selectedcats= destlist.????
    cfdataInsert.addData({user:myobj})
    ]]>
    </mx:Script>
    Second part of my question is that I want the value of
    myobj.selectedloops to be a comma separated list of categoryid
    numbers (e.g. 1,3,5). My query, that populates the source list via
    the remoteobject contains categoryid,category, and description
    columns. I currently display the category in the labelField of the
    list, but I need to submit the categoryid to the DB.
    data comes from...
    <mx:RemoteObject
    id="cfdata" showBusyCursor="true"
    destination="ColdFusion"
    source="da8.Constellation.entries">
    <mx:method name="getCats" result="getCats_result(event)"
    />
    </mx:RemoteObject>
    getCats ColdFusion function...
    <cffunction name="getCats" access="remote"
    returntype="query">
    <cfset var CatData = "">
    <cfquery name="CatData" datasource="#DSN#">
    select categoryid,category,description
    from Categories
    order by category
    </cfquery>
    <cfreturn CatData />
    </cffunction>
    and then this function populates the srclist with the
    data....
    public function getCats_result(event:ResultEvent):void
    srclist.dataProvider = event.result as ArrayCollection;
    destlist.dataProvider =[];
    How do I pass the resulting destlist categoryids to
    myobj.selectedcats ?
    I don't know how the ArrayCollection organizes the query and
    how to reference the categoryid in the srclist and destlists.
    I'd appreciate any help.
    Thanks,
    Don

    SAP has lots of demo reports for drag and drop functionalities. Please check [Drag & Drop With the ALV Grid Control|http://help.sap.com/saphelp_erp2004/helpdata/en/22/a3f5fbd2fe11d2b467006094192fe3/content.htm]

  • How to use the drop event of the tree control in LabVIEW 8.20?

    Hi,
                I am using the two tree controls in my application to provide a option for the user to drag and drop item from one tree to the other.  I have to validate the user selection. I tried to capture the user drop event  using the event structure. The problem I am facing is, I am not able to drop the item even though i have wired a constant true to the filter(Accepted?) in the event case. I have enable the property(Allow droping) in the right menu of the tree control also.
              While configuring an event case for (drop, drag entered and some thing like this) only I am getting the problem otherwise it is working fine.  
    What do i need to do to caprture the drop event ?
    Is there any way to avoid the item duplication while droping a new item in the tree control ?
    or how can i do this?
    Thanks,
    Pandiarajan R

    Hi Pandiarajan,
    I hope you are doing well today! There is a lengthy discussion on the Tree Control Drag & Drop feature at this forums post including contributions from the developer of the Drag & Drop feature:
    Tree Control Drag & Drop in LabVIEW 8
    By avoiding item duplication, do you mean that you don't want the same item to be in the old tree control or do you not want more than one item in the new tree control?
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • How to drag drop a calendar item to a time in next week ?

    Hi
    creating a event through a big menu is fine ... but a very elegant and quick way is to select the cells and write the event. similarly, drag-drop a event is super easy way to re-schedule an event to another time. when i have 20-30 events to re-schedule from current to next week, drag-drop is best.
    however, i am unable to do that. when i drag drop, i cant drop it to next week (i am using weekly view to be able to select any time of destination day for drop - the bi-weekly or monthly views don't allow choice of destination time)
    this could be implemented in two ways :
    1. in current weekly view, if the drag crosses the boundary, calendar shifts to the next (or previous) week. and then i drop the event.
    2. there can be a option to see upto 2 weeks in columns just like 1 week view. i understand that the columns will be too tight but the fullscreen option makes it very usable.
    or, you can suggest your own work-around.

    instead of using target, try using currentTarget...
    event.currentTarget.startDrag();
    event.currentTarget.stopDrag();

  • Able to drag drop items of combobox but want to disable 1st item

    Hello Sir,
    I am able to drag drop elements of the combobox.
    Here is my code...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:local="*" xmlns:utils="adobe.utils.*" xmlns:controls="qs.controls.*" initialize="init()">
    <mx:Script>
    <![CDATA[
    import mx.events.DragEvent;
    import mx.events.ListEvent;
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.controls.ComboBox;
    import mx.controls.Alert;
    [Bindable]
    public var str:String = "";
    public var comboLength:int;
    public function init():void
    var xml:XML = <test>
    <col>
    <col1>one</col1>
    </col>
    <col>
    <col1>two</col1>
    </col>
    <col>
    <col1>three</col1>
    </col>
    <col>
    <col1>four</col1>
    </col>
    <col>
    <col1>five</col1>
    </col>
    <col>
    <col1>six</col1>
    </col>
    <col>
    <col1>seven</col1>
    </col>
      </test>;
      cb1.dataProvider = xml;
      comboLength = xml.col.length();
      cb1.rowCount = comboLength;
      str = (xml.col[0].col1.toString());
      cb1.prompt = str;
    public function closeHandler(event:Event):void
    if(MouseEvent.DOUBLE_CLICK)
    // Alert.show("Click Event");
    public function changeHandler(event:ListEvent):void
    // Alert.show("Single Click Event");
    public function doubleClickEvent(event:MouseEvent):void
    Alert.show(event.currentTarget.toString());
    Alert.show(event.target.toString(),"Double Click");
    public function dragEnterFunction(event:DragEvent):void
    Alert.show(event.target.parent.toString());
    ]]>
    </mx:Script>
    <mx:ComboBox id="cb1" prompt="prashant" doubleClickEnabled="true" doubleClick="doubleClickEvent(event)"
    close="closeHandler(event)" dragEnter="dragEnterFunction(event)" >
    <mx:itemRenderer>
    <mx:Component>
    <mx:DataGrid itemClick="outerDocument.cb1.text = this.selectedItem.col1.toString();itemSelected(event)"
    dragEnabled="true" dropEnabled="true" dragDrop="draDropHandler(event)" dragMoveEnabled="true" headerHeight="0" showHeaders="false"
    creationComplete="init()" click="clickable()"
    itemDoubleClick="doubleClickEvent(event)">
    <mx:columns>
    <mx:DataGridColumn dataField="col1" headerText="" id="da" disabledColor="white"  />
    </mx:columns>
    <mx:Script>
    <![CDATA[
    import mx.controls.DataGrid;
    import mx.events.DropdownEvent;
    import mx.events.ListEvent;
    import mx.events.DragEvent;
    import mx.controls.Label;
    import mx.controls.Alert;
    public function clickable():void
    //Alert.show("clickable");
    public function itemSelected(event:ListEvent):void
    Alert.show(event.itemRenderer.data.col1,"Single Click");
         public function draDropHandler(event:Event):void
    Alert.show(event.target.parent.toString());
    public function dragEnterFunction(event:DragEvent):void
    Alert.show(event.target.parent);
    override public function set data( value:Object ) : void
    this.dataProvider = value.col;
    //outerDocument.cb1.text = this.selectedItem.col1.toString()
    //myList.addEventListener(ListEvent.ITEM_DOUBLE_CLICK, onItemDoubleClick,
    public function doubleClickEvent(event:ListEvent):void
    Alert.show(event.itemRenderer.data.col1,"Double Click");
    ]]>
    </mx:Script>
    </mx:DataGrid>
    </mx:Component>
    </mx:itemRenderer>
    </mx:ComboBox>
    </mx:Application>
    But now i want to disable drag drop of the 1st item and the last item.
    And also add double click of each item.
    Can someone please help me out.
    Awaiting your reply.
    Thanks in advance.

    Hello Sir,
    Thanks a lot for your reply.
    I have implemented some thing can you please help me out with this?
    In this can you help me out with the double click event????
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
    xmlns:local="" xmlns:utils="adobe.utils." xmlns:controls="qs.controls.*"
    initialize="init()">
    <mx:Script>
    <![CDATA[
    import mx.events.DragEvent;
    import mx.events.ListEvent;
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.controls.ComboBox;
    import mx.controls.Alert;
    import mx.controls.listClasses.ListBase;
    import mx.core.UIComponent;
    public var str:String = "";
    public var comboLength:int;
    public function init():void
    var xml:XML =
    </mx:Application

  • Drag/Drop a label placing it in its new x,y co-ordinates

    I'm working on a project where I need to drag a label around
    and when dropped, it should be placed wherever my mouse is. So far,
    I can drag it onto a canvas, but it dissapears - when i drag the
    label onto the canvas, its location should be wherever my mouse is
    currently at, ie. i want to drag a label then drop it to a new
    location.
    I already know the code for all the drag functions &
    classes (dragInitiator)- but I'm wondering about the code to
    implement dropping the label to a new location based on my mouse's
    x,y co-ordinates. Please help. Thank you.

    i think u need to do some computation here ... while in the
    dragit() event u should have an account of the mouseX and mouseY
    positions (the positions on the label not the container) with you.
    Then finally when u are dropping it ... u have to take into account
    that u subtract a relative value of this mouse X & Y (relative
    to the container) from the actual container.mouseX and
    container.mouseY.
    here is an example that is working on my system :-
    private function dragIt(event:MouseEvent, text:String, //
    [this is the mouse move event]
    format:String):void {
    tempX = this.mouseX;
    tempY = this.mouseY;
    var dragInitiator:Label = new Label();
    private function dragDropIt(event:DragEvent):void{ // [this
    is the drag complete event]
    this.x=this.parent.mouseX - tempX;
    this.y=this.parent.mouseY - tempY;
    I hope u find the solution with this!
    Sumitro

  • Reseting a drag & drop game

    Hello All:
    I'm having trouble reseting a drag & drop game. It is a movie clip with two pages: start_pg and game_pg. On start_pg is a start button (start_btn) that goes to game_pg. On game_pg is button (end_btn) that goes back to start_pg. Both buttons share the same layer, so I made each invisible when not of its page. The game works fine, but when the end_btn is clicked, all movie clips that have been dropped, stay there.
    How can I go back to start_pg and reset all movie clips to their original starting point?
    // start game page
    stop();
    end_btn.visible=false;
    start_btn.visible=true;
    start_btn.addEventListener(MouseEvent.CLICK, goGame);
    function goGame (Event:MouseEvent): void
    gotoAndStop("game_pg");
    // game page
    var startX:Number;
    var startY:Number;
    var counter:Number = 0;
    pic_1.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_1.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    pic_3.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_3.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    pic_2.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_2.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    pic_4.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_4.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
    event.target.startDrag(true);
    event.target.scaleX = 1.2;
    event.target.scaleY= 1.2;
    m_txt.text = "";
    event.target.parent.addChild(event.target);
    startX = event.target.x;
    startY = event.target.y;
    function dropIt(event:MouseEvent):void {
    event.target.stopDrag();
    var myTargetName:String = "target" + event.target.name;
    var myTarget:DisplayObject = getChildByName(myTargetName);
    if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
      event.target.width = 230;
      event.target.height= 190;
      m_txt.text = "Good Job!";
      event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
      event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
      event.target.buttonMode = false;
      event.target.x = myTarget.x;
      event.target.y = myTarget.y;
      counter++;
    } else {
      m_txt.text = "Try Again!";
      event.target.x = startX;
      event.target.y = startY;
      event.target.width = 50;
    event.target.height= 40;
    if(counter == 4){
            m_txt.text = "Congratulations, you matched all rivers correctly!";
    pic_1.buttonMode = true;
    pic_2.buttonMode = true;
    pic_3.buttonMode = true;
    pic_4.buttonMode = true;
    // end game button
    start_btn.visible=false;
    end_btn.visible=true;
    // end game button
    end_btn.addEventListener(MouseEvent.CLICK, goStart);
    function goStart(Event:MouseEvent):void
    gotoAndStop("start_pg");
    Thanks in advance for any assistance.
    German

    Kglad:
    All my movie clips are on stage. Does it make any difference?
    I tried three options: 1) I didn't change the two functions and added the restore XY action to end_btn. It didn't work.
    end_btn.addEventListener(MouseEvent.CLICK, goStart);
    function goStart(Event:MouseEvent):void
    restoreXY(MovieClip(root));
    gotoAndStop("start_pg");
    The second option. In each function I changed
    the last part restoreXY(mc[obj]); to restoreXY(MovieClip(root));  (this didn't work)
    The third option was adding the storeXY to my function pickUp (which is when all movie clips exist in their original position) and keeping the restore action in end_btn. Didn't work.
    function pickUp(event:MouseEvent):void {
    event.target.startDrag(true);
    event.target.scaleX = 1.2;
    event.target.scaleY= 1.2;
    m_txt.text = "";
    event.target.parent.addChild(event.target);
    startX = event.target.x;
    startY = event.target.y;
    storeXY(MovieClip(root));
    In all cases, I got errors in many lines such as
    1120: Access of undefined property obj the scritp is   if(mc[obj] is "MovieClip" && mc[obj].parent==mc){
    Can you please tell where in my code I should put the storeXY and restoreXY(MovieClip(root));?
    Thanks again for helping me.
    German

  • Issue with Drag/Drop of multiple rows from ListView

    I am working on a sample application with 2 list views i.e. players and team, and implement drop and drop such that players can be dropped from one list view to the other. Everything is working as expected when there is single selection model is enabled on the source list view. However, if I enabled Multiple selection model and drag 2 or more rows from source list view to target list view, seeing the following exception after the drop is completed.
    Exception:
    java.lang.IllegalArgumentException: Only serializable objects or ByteBuffer can be used as data with data format [subListPlayers]
      at com.sun.javafx.tk.quantum.QuantumClipboard.putContent(QuantumClipboard.java:513)
      at javafx.scene.input.Clipboard.setContent(Clipboard.java:230)
    1) What should be the DataFormat used in order to be able to drag and drop multiple rows? Looks like we do not have for Object type, so I have created the following one which does not solve the problem.
       private DataFormat dataFormat = new DataFormat("subListPlayers");
    2) I have made changes to support serialization on the data object which also does not seem to solve the issue. Tried by implementing Serializable interface as well as by implementing Externalize interface.
    Can someone please guide if there is an easy way to implement this behavior?
    Code:
    public class Player
       private String name;
       public Player(String name)
          this.name = name;
       public String getName()
          return name;
       public void setName(String name)
          this.name = name;
       @Override
       public boolean equals(Object o)
          if (this == o) return true;
          if (o == null || getClass() != o.getClass()) return false;
          Player player = (Player) o;
          if (name != null ? !name.equals(player.name) : player.name != null) return false;
          return true;
       @Override
       public int hashCode()
          return name != null ? name.hashCode() : 0;
    public class JavaFXDnDApplication extends Application
       private static final ListView<Player> playersListView = new ListView<Player>();
       private static final ObservableList<Player> playersList = FXCollections.observableArrayList();
       private static final ListView<Player> teamListView = new ListView<Player>();
       private static final GridPane rootPane = new GridPane();
       private DataFormat dataFormat = new DataFormat("subListPlayers");
       public static void main(String[] args)
          launch(args);
       @Override
       public void start(Stage primaryStage)
          primaryStage.setTitle("Drag and Drop Application");
          initializeComponents();
          initializeListeners();
          buildGUI();
          populateData();
          primaryStage.setScene(new Scene(rootPane, 400, 325));
          primaryStage.show();
       private void initializeListeners()
          playersListView.setOnDragDetected(new EventHandler<MouseEvent>()
             @Override
             public void handle(MouseEvent event)
                System.out.println("setOnDragDetected");
                Dragboard dragBoard = playersListView.startDragAndDrop(TransferMode.MOVE);
                ClipboardContent content = new ClipboardContent();
    //            content.putString(playersListView.getSelectionModel().getSelectedItem().getName());
                content.put(dataFormat, playersListView.getSelectionModel().getSelectedItems());
                dragBoard.setContent(content);
          teamListView.setOnDragOver(new EventHandler<DragEvent>()
             @Override
             public void handle(DragEvent dragEvent)
                dragEvent.acceptTransferModes(TransferMode.MOVE);
          teamListView.setOnDragDropped(new EventHandler<DragEvent>()
             @Override
             public void handle(DragEvent dragEvent)
    //            String player = dragEvent.getDragboard().getString();
    //            ObservableList<Player> player = (ObservableList<Player>) dragEvent.getDragboard().getContent(dataFormat);
                String player = dragEvent.getDragboard().getString();
                teamListView.getItems().addAll(new Player(player));
                playersList.remove(new Player(player));
                dragEvent.setDropCompleted(true);
       private void buildGUI()
    //      rootPane.setGridLinesVisible(true);
          rootPane.setPadding(new Insets(10));
          rootPane.setPrefHeight(30);
          rootPane.setPrefWidth(100);
          rootPane.setVgap(20);
          rootPane.setHgap(20);
          rootPane.add(playersListView, 0, 0);
          rootPane.add(teamListView, 1, 0);
       private void populateData()
          playersList.addAll(
                new Player("Adam"), new Player("Alex"), new Player("Alfred"), new Player("Albert"),
                new Player("Brenda"), new Player("Connie"), new Player("Derek"), new Player("Donny"),
                new Player("Lynne"), new Player("Myrtle"), new Player("Rose"), new Player("Rudolph"),
                new Player("Tony"), new Player("Trudy"), new Player("Williams"), new Player("Zach")
          playersListView.setItems(playersList);
       private void initializeComponents()
          playersListView.setPrefSize(250, 290);
          playersListView.setEditable(true);
          playersListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
          playersListView.setCellFactory(new Callback<ListView<Player>, ListCell<Player>>()
             @Override
             public ListCell<Player> call(ListView<Player> playerListView)
                return new ListCell<Player>()
                   @Override
                   protected void updateItem(Player player, boolean b)
                      super.updateItem(player, b);
                      if (player != null)
                         setText(player.getName());
          teamListView.setPrefSize(250, 290);
          teamListView.setEditable(true);
          teamListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
          teamListView.setCellFactory(new Callback<ListView<Player>, ListCell<Player>>()
             @Override
             public ListCell<Player> call(ListView<Player> playerListView)
                return new ListCell<Player>()
                   @Override
                   protected void updateItem(Player player, boolean b)
                      super.updateItem(player, b);
                      if (player != null)
                         setText(player.getName());

    Yeah, this is a pain. I filed https://javafx-jira.kenai.com/browse/RT-29082 a while back. Go ahead and vote for it if you are inclined...
    I think the issue in your case is that the observable list provided by MultipleSelectionModel.getSelectedItems() is not Serializable. So even if you make your Player class Serializable, the list itself isn't. The first thing I would try, I think, is to make Player implement Serializable and then pass in an ArrayList instead of the observable list. So you can do
    content.put(dataFormat, new ArrayList<Player>(playersListView.getSelectionModel().getSelectedItems()));
    and
    List<Player> player = (List<Player>) dragEvent.getDragboard().getContent(dataFormat);
    teamListView.getItems().addAll(player);
    If that doesn't work, a workaround is just to store the "dragged list" in a property:
    final ListProperty<Player> draggedPlayers = new SimpleListProperty<Player>();
    // Drag detected handler:
    content.putString("players");
    draggedPlayers.set(playersListView.getSelectionMode().getSelectedItems());
    // Drag dropped handler:
    if (dragboard.hasString() && dragboard.getString().equals("players")) {
         teamListView.getItems().addAll(draggedPlayers.get());
         draggedPlayers.set(null);

  • Drag & drop item within Tree not working

    Hi,
    I want to be able to drag & drop items within a tree but
    items cannot move accross branches
    It can only be moved within its branch.
    For this I have a condition in dragDrop(event) handler.
    When i drag item it does not move accross branches which is
    intended but when i drop within its branch
    on a different location,
    the item does
    not get dropped
    Though i have dragMoveEnabled set to true.
    my code looks like this:
    private function onDragDrop(event:DragEvent):void {
    var dropTarget:Tree = Tree(event.currentTarget);
    var node:XML = myTree.selectedItem as XML;
    var p:*;
    p = node.parent();
    if(node.parent().@label != "sameBranch") {
    return;
    } else {
    // drop target.
    Do i need to do anything else...
    Please advice.
    Thanks
    Lucky

    topping up, still did not find a way to do...
    but i have handled all tree events like dragEnter and
    dragDrop as described in the flex doc.
    Has anyone faced a similar issue...

Maybe you are looking for