List drag & drop issue

hi,
I have two lists - available items list and selected items
list.
I want to drag and drop only if some condition satisfies for
which i have code like
onDragEnter(event) {
if (fail) {
DragManager.showFeedback(DM.NONE);
return;
When dragged and dropped if the condition fails the selected
item is moved back to the drag position
but it leaves a copy of this item in the selected list as
well.
I tried the above code in onDragDrop(event) as well but has
the same result.
How can i avoid a copy of the selected item on fail
condition.
Please advice.
Lucky

onDragEnter(event) {
if (fail) {
event.preventDefault();
DragManager.showFeedback(DM.NONE);
return;
}

Similar Messages

  • ADG drag&drop issue

    Hey all,
    A strange problem i came across:
    I have a ADG which gets its data from an XML of 3 levels
    (<root><node><childnode/></node></root>)
    All works great but i have this strange issue:
    Once a drag&drop action is completed the first row of the
    ADG is automaticly selected.
    I tried using the dragComplete event and set the
    myADG.selectedIndex to null, or -1 but it doesnt do anything (the
    first row is still auto selected),
    I did find that if i use myADG.expandall() in the
    dragComplete event it does work, but it doesnt help me...
    So my question is: how can i make the ADG not to select any
    row after drag&drop action?
    Thanks

    onDragEnter(event) {
    if (fail) {
    event.preventDefault();
    DragManager.showFeedback(DM.NONE);
    return;
    }

  • JSF dataTable Drag & Drop issue

    Hi, I'm developing a project with JSF where I have a dataTable made with 11 columns and unlimited rows. Each cell is populated by StaticText components. When I do a drag & drop (mousedown/mouseup) the StaticText text values between the drag point and the drop point are highlighted in blue. This is confusing to my users. Is there a way to turn-off the auto highlighting of a StaticText component. I don't see any property or style that will do this for me.
    Your assistance is greatly appreciated.
    Don

    Write a Servlet Filter that will set the character encoding to utf-8. Here is the code.
    public class UTFEncodingFilter implements Filter {
        public void init(FilterConfig arg0) throws ServletException {
        public void doFilter(ServletRequest request, ServletResponse response,
                FilterChain chain) throws IOException, ServletException {
            request.setCharacterEncoding("UTF-8");
            chain.doFilter(request, response);
        public void destroy() {
    }

  • Tile List drag Drop

    Hi
    I have made a tile list dynamically using a function and
    objects.
    in this images are there which are to be dragged and there
    are tilelists which are made by mxml tags
    in this images are to be dropped.....
    but always I drag and drop the images itno Tilelist which ar
    emxml originated ....shows a error in .as file throwing error
    like--
    ther should be XML or xmllist type...
    plz help me out...ASAP

    Hi,
    the way you tried to add some more fields in a list tile is not working.
    In lists the data is not retrieved from Business objects/collections but from record sets which are fetched from the main segment of the underlying query BDoc (I guess sth like OPP_blabla_QUERY).
    Therefore what you could do is to enhance this query BDoc and add these tables by joining them to the opportunity header table. In this case you also need to specify exactly these segment field names in the property of the new list column fields.
    Much faster (but a little bit dirty) would be to use the row loaded2 event where you can calculate the values you want to display. In this case the controls would have to be unbound.
    The second version would cost a little bit more performance, but this depends from the data volume.
    Regards,
    Wolfhard

  • Photo's for Mac - Drag/Drop issue

    I used to be able to drag and drop photos from iPhotos to Photobucket and it won't let me now since the upgrade to Photo's for Mac. Does anyone know why and is this just a bug that will be fixed in time?

    'Why' questions are ones that only Apple can answer.
    Try use the Media Browser.

  • KDE, ntpd and drag&drop issues

    Hi,
    I use KDE and when I install ntpd (the problem disappears when I remove it) and I want to drag something (like windows), the dragging procedure starts after 5-6 seconds, so I have to hold the mouse in the position for 5-6 seconds. (it also happens when I try to select text).
    Do you have encountered such a problem? Do you know how to fix the problem?
    -nwxxeh

    ewaller wrote:
    Weird. 
    Okay, so when kde and ntp are installed, and ntpd is running, where are your processors spending their time?  Use htop, or whatever that process monitor thing in KDE is called to find out what, if anything is sucking up processor cycles.  Let us know.
    Everything seems normal to me (htop).
    Also, it happens on XFCE and Gnome, so it may be X11 issue.
    Also, when I have ntp and timezone set to GMT+2, when I reboot my time sets to GMT+4 (not timezone, just time)...

  • New 16GB iTouch - cannot manually drag/drop songs

    I just purchased a new 16GB iTouch this past wkd from the Apple store. (As background I have previously owned the 1st generation and latest iPod nanos). After reading some of the posts, I decided not to upgrade the software to v3.0.
    I connected the iTouch to my computer, and it is recognized by iTunes. I unchecked any related "automatically sync" features and made sure that "manual sync" was turned on. However, I still cannot seem to "drag and drop" songs from my Music Library to my iTouch; I also cannot "drag and drop" any of my playlists. I have not even tried to bother with my photos. Also, please note, my iTunes works just fine with both of my iPods.
    Please help!!! Am I having this problem b/c I am not upgrading the iTouch software to the new version?

    roaminggnome - thanks for your quick reply. Apologies, I should have been more specific in my post. So that my songs would not be automatically synched, I had previously checked the box under devices/my ipod/summary/manually manage music" - I also had done so for both of my old iPods.
    I already downloaded the manual and read thru a bunch of older posts and I could not find any reference to this "drag/drop" issue.

  • 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 and Drop issue from Explorer folder to Music Library

    Hello
    I just updated my iTunes to 8.0.0.20 but something unexpected happened. I can’t drag and drop anymore songs from an explorer folder into my music library when my view mode is set to Grid (Album, Artist, Genre or Composer).
    When I try I have a kind of interdiction circle under my pointer.
    I can only perform this operation in list mode view. Few hours ago it was still possible to perform it but not after I updated. I reinstalled my iTunes but the problem persists.
    I have read the forums I know I can add to my playlist as usual by using the menu. But is it possible to get drag and drop operation when I drags song directly from a folder on my explorer window?
    It would be very appreciated if someone has an answer. I really messed up my library trying to fix this

    I fixed the drag and drop issues I had! Turns out they were caused by the permission problems of Vista. To fix it I just made sure all the files in the iTunes folder and sub folders were full control by my account.
    Make sure you check the properties of the iTunes database specifically because before, the iTunes folder had the correct permissions but they hadn't actually been inherited correctly by the iTunes DB files. Hope this helps anyone else.

  • Drag and Drop issue in Jlist - Transferhandler not working

    Hi all,
    I have a problem associated with the drag and drop of components into a Jlist.
    When I drag component out of a Jlist, the control reaches inside transfer handler, but when I try to insert a component into the Jlist, the control does not reach inside Jlist transfer handler.
         jlist.setDropMode(DropMode.INSERT);
         jlist.setDragEnabled(true);
         jlist.setTransferHandler(new TransferHandler()
                   List fileList;
                   boolean export = false;
                   List<File> newList = null;
                   protected Transferable createTransferable(JComponent c)
                        System.out.println("inside handler");
                                    ..............................Please help me with this issue.
    Any help in this regard will be well appreciated with dukes.
    Regards,
    Anees

    AneesAhamed wrote:
    Hi all,
    I have a problem associated with the drag and drop of components into a Jlist.
    When I drag component out of a Jlist, the control reaches inside transfer handler, but when I try to insert a component into the Jlist, the control does not reach inside Jlist transfer handler.
    jlist.setDropMode(DropMode.INSERT);
    jlist.setDragEnabled(true);
    jlist.setTransferHandler(new TransferHandler()
                   List fileList;
                   boolean export = false;
                   List<File> newList = null;
                   protected Transferable createTransferable(JComponent c)
                        System.out.println("inside handler");
    ..............................Please help me with this issue.
    Any help in this regard will be well appreciated with dukes.If you're wondering why your createTransferable() method is not called when you drag from some other component and drop into the list it is because createTransferable() is called when you start dragging. So it would be the TransferHandler of the source component, not your target list, that has its createTransferable() called in that case.
    When the list is the target of a drag&drop you should see the canImport() method of your TransferHandler being called. Do a System.out(0 in that method as well and see if that is the case.

  • ALV List drag and drop..

    Hi
    In Cj20n open an existing project.
    I am currently trying to drag and drop a WBS element.
    I pick a WBS from the template and try to drop over  the Project then try to replace and Include that WBS from template into the project opened.
    During this time the system should accept only if source and destination Project types are same other wise it should give an error message out.
    Has any one worked on similar thing on ALV List drag and drop...
    Actually there are no User Exits or Badi's for this.
    Let me know if any OSS Notes ...
    Your Inputs will be of great help.
    Thanks a lot.

    this is how sap works, it does not check coherence at the abap side, and it's only when the true call is made at the frontend what we see the issue. The only way to find the bug is to check all values of the internal table (try to test a simple tree first, and increase complexity step after step, until you find what is incorrect). One of the errors I made in the past was the way I defined the folders, I forgot to define ISFOLDER = 'X', and that used to trigger this error.

  • 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]

  • Change items' order in a list by drag-drop

    Hi, Is it possible to allow the user to change the items displayed in a List by just drag-&-drop?
    Thanks.

    [url http://java.sun.com/docs/books/tutorial/uiswing/dnd/intro.html#complex]Extending DnD Support

  • Mail attachment drag and drop issue

    Been facing serious mail attachment drag-and-drop issue since 10.8 (if not from 10.7) and was disappointed to find the same behaviour still in 10.9.
    When I drag and drop a picture file (from Finder for example) into a message window or onto the Mail.app Dock icon, the system's window management somehow gets confused: my next step is to click on the message window in order to start typing. However, the mouse click causes that very window to escape under all other open applications / windows. Further on, I dig under to find the escapee and click again: once more it escapes. This can go on for a few annoying rounds until gets solved in an unexplainable way. This behaviour in not consistent, but has happens in about 8 cases out of 10.
    Apart from Mail.app I do not experience drag and drop issues of any kind.
    Anyone else suffering from this?

    I'd be interested in the answer to this too.
    It only just started happening to me a day or so ago, about the time that I think I did an OS upgrade.
    I'm on OSX 10.8.2.
    Its annoying.
    I can drop and drag in Finder but it just affects email.

  • Drag and drop issue alternatives

    Hello
    i'm having the same drag and drop issue as the other guys here. basically cant drag and drop to the desktop. Im looking for a workaround that doesnt involve making temporary backups or repairing iphoto libraries. My library is 260gb and even though it is being backed up i dont have a spare 260gb.

    That does not exist - the workaround (maybe permanent solution - who knows) is
    File menu ==> export
    And BTW if you are not backingup all the time you are 100% guarenteed to lose all of your files and photos sooner or later
    LN

Maybe you are looking for