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

Similar Messages

  • 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;
    }

  • 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

  • Strange Problem Drag & Drop Between Lists

    In the following code, drag & drop is set to copy objects, but when more than one instance of an item exists, only the last item (highest data provider index) item can be selected. Any idea why this is happening, and how to correct this?
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="init();">
      <mx:Script>
        <![CDATA[
          import mx.collections.ArrayCollection;
          [Bindable] private var srcAC:ArrayCollection = new ArrayCollection();
          [Bindable] private var destAC:ArrayCollection = new ArrayCollection();
          private function init():void{
            srcAC = new ArrayCollection(['Fish', 'Meat', 'Chicken']);
            destAC = new ArrayCollection();
          private function displayData():void{
            trace("****************************************");
            trace("menuList dataProvider:");
            for each(var srcItem:Object in srcAC){
              trace("\t" + srcItem.toString());
            trace("----------------------------------------");
            trace("orderList dataProvider:");
            for each(var destItem:Object in destAC){
              trace("\t" + destItem.toString());
        ]]>
      </mx:Script>
      <mx:HBox>
        <mx:VBox>
          <mx:Label text="Today's Menu" fontWeight="bold" fontSize="14"/>
          <mx:List id="menuList" width="200" dataProvider="{srcAC}"
            dragEnabled="true" dropEnabled="true" dragMoveEnabled="false"
            allowMultipleSelection="true" fontSize="14"/>
        </mx:VBox>
        <mx:VBox>
          <mx:Label text="Your Order" fontWeight="bold" fontSize="14"/>
          <mx:List id="orderList" width="200" dataProvider="{destAC}"
            dragEnabled="true" dropEnabled="true" dragMoveEnabled="false"
            allowMultipleSelection="true" fontSize="14"/>
        </mx:VBox>
      </mx:HBox>
      <mx:Button id="b1" label="Reset Order" click="init();"/>
      <mx:Button label="Display Data Providers" click="displayData();"/>
    </mx:Application>

    Hello
    Actually I have also face this problem in one of my appliocation so have done some work arround for that.
    If we use object of ArrayCollection as 'key-value' (like- {label:'Fish'} ) pair than it work fine.
    srcAC = new ArrayCollection([ {label:'Fish'},{label:'Meat'},{label:'Chicken'}]);
    In case of
    srcAC = new ArrayCollection(['Fish', 'Meat', 'Chicken']);
    If we drop same item two times than list is not identify unique item of the list
    and if we use objet like- {label:'Fish'} than every item is unique for list.
    I m not sure this is right or not but it works fine.
    Also we need to set 'labelField' of list as per object.
    With Regards
    Virat Patel

  • Drag & Drop, call a method if list changes.

    Hi there,
    I have two spark lists,backed up by Array Collections, both of which accept drag & drop either to move objects between them or to reorder within the lists. I have a method which is called on drop which resets some properties of the object to 0, this works as expected...
    protected function list_dragDropHandler(event:DragEvent):void
         if(event.action != DragManager.NONE)
              var item:Object = event.dragSource.dataForFormat("itemsByIndex")[0];
              item.someProperty = 0;
                    item.someOtherProperty = 0;
    What I would like to do is only call this method only when the objects are moved to another list, currently it is called when I reorder within the same list too, could someone please point me in the right direction with this?
    Many Thanks,
    J.

    Ned,
    Thanks for your prompt reply, you gave me the idea I needed here. As I'm dragging things about by their item renderers a creationComplete is fired when they end up in new places, I used a mouseDown event (This happens when one drags, it's as good an event as any to use I guess) to grab the current list and I compare that to the list I get when creationComplete fires. These are stored in the object and compared by the dragDrop event handler...
    Probably an inelegant take on what you were suggesting, but it works...
    J.

  • Refresh dragProxy in List component built-in drag & drop feature

    Hi,
    I'm using the built-in drag & drop feature of the List component. Everything works fine except one thing. The itemRenderer I use in my List contains many TextInput that the user can fill. The problem is when I drag an itemRenderer to reorder my list, the dragProxy of the itemRenderer doesn't show the text I enter in the TextInput; it shows the original state of my itemRenderer.
    Is there any way to update the dragProxy to reflect the changes made in the itemRenderer ?
    Thank you!
    Matetnic

    If editable=true, the user's changes should be saved to the dataprovider when the drag starts.  The dragproxy renders whatever is in the dataprovider item
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

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

  • TileList Drag/Drop functionality is broken if the same item is dropped twice or more

    Hi Folks.
    This is quite frustrating.
    I'm using two tilelists and you can drag items from one to
    the other.
    If you drag an item more than once then when you rollover
    that item it highlights the second(or most recent) version of the
    item you dragged.
    Basically the second tile list is containing exact copies of
    the first, so that when you rollover an item it is behaving as if
    only the most recent addition to the component is there.
    Here is the code.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="560" height="341">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable]
    private var listArray:Array=[
    {label: "item0", data: 0},{label: "item1", data: 1},
    {label: "item2", data: 2},{label: "item3", data: 3},
    {label: "item4", data: 4},{label: "item5", data: 5},
    {label: "item6", data: 6},{label: "item7", data: 7}];
    [Bindable]
    public var cartFilterCol:ArrayCollection ;
    ]]>
    </mx:Script>
    <mx:Canvas width="568" height="340">
    <mx:TileList
    id="filterTilelist"
    direction="vertical"
    dataProvider="{listArray}"
    itemRenderer="mx.controls.Button"
    allowMultipleSelection="false"
    dragEnabled="true"
    width="219"
    borderStyle="inset" height="228" x="48" y="36">
    </mx:TileList>
    <mx:TileList backgroundColor="#ffffff"
    dataProvider="{cartFilterCol}"
    dropEnabled="true"
    allowMultipleSelection="false"
    dragMoveEnabled="true"
    dragEnabled="true"
    borderStyle="inset"
    columnCount="1"
    height="228" width="194" x="275" y="36">
    </mx:TileList>
    </mx:Canvas>
    </mx:Application>
    I think this is the issue here
    https://bugs.adobe.com/jira/browse/SDK-11894
    It seems to suggest that this issue is resolved but it
    doesn't go into details. Can anybody help me, even an ugly hack
    would do? Have tried several things like manually setting the
    mx_internal_uid on object beign dragged before it is dropped but no
    luck so far. I'm using Flex builder 2.0.1.
    Thanks
    Rob

    Check that you still have the "Bookmarks Toolbar items" placed on the Bookmarks Toolbar
    * Make sure that you have the "Bookmarks Toolbar" visible: "View > Toolbars"
    * Check in "View > Toolbars > Customize" that the "Bookmarks Toolbar items" is on the Bookmarks Toolbar
    * If the "Bookmarks Toolbar items" is not on the Bookmarks Toolbar then drag it back from the Customize window onto the Bookmarks Toolbar
    * If you do not see the "Bookmarks Toolbar items" then click the "Restore Default Set" button
    You can only move the content from a toolbar onto other toolbars if all toolbars support that feature. You need to check that in the options of each toolbar.

  • I deleted the "desktop" in tiger, can't "alias", "copy" or "drag & drop" anything to it now, I get a message that "desktop can not be changed"

    I was trying to make an alias of "SAFARI" icon to have on the desktop & in the dock as well, I managed to make the safari icon appear on the desktop, but when I wanted to switch from firefox to safari it wouldn't open / start safari, so OK, no big deal, I moved it the trash, ( by rt. click,>move to trash>click ) the horror starts here, everything on the desktop disappeared into the trash !!!!! ......
      So I have tried to "drag & drop", "alias", "copy", "duplicate" to get things back out of the trash, but every attempt is met with a message "the desktop con not be changed",   and whatever I try to bring anything out of the trash window, it gets a "minus - sign" added to it when it crosses over the edge of the trash window, and of course it jumps right back into the trash when the mouse button is released.
    I think (barely) I will need the do a "clean install", or a "restore" from the install DVD to restore / get the desktop back.
    And while the only thing on the desktop now is the HDD icon, clicking it open does not show the desktop in the Lf. column of the window where it should be, or any OS X folders when clicking on anything, but the OS is is running for this post and yahoo, etc., and there is a upward facing arrow next to the "network" name in the left column, that doesn't go away, like after installing some software, this is weird !!
    Any solid ideas welcomed, and Thanks for reading my driveling post,  .....  wayne146  .........
    this is happening on my back-up machine, a G4 400mhz PCI, OS X TIGER 10.4.11 & 9.2.2 in classic ( all the 9.2.2 stuff does still show in the hdd when clicked )
    I am having bigger troubles with my QS 800 dp, so I need this one to stay online, Please help !!!

    to safari it wouldn't open / start safari, so OK, no big deal, I moved it the trash, ( by rt. click,>move to trash>click ) the horror starts here, everything on the desktop disappeared into the trash !!!!!
    I am confused by what you did.
    open / start safari
    What did you do?  This looks like a terminal command.
    Or, did you click on the safari icon then right click on the safari icon then click on open? 
    I do not understand how you that moving to the trash would be helpful.
    I suspect disk corruptions.
    I run disk utility verify the file system on your starup disk.  See below.
    verify & repair your startup drive
    To verify & repair you file system on the startup drive, you will need to run disk utility from you installation DVD.
    This article  will tell you how to get to disk utility.  Once in a disk utility, you can go and attempt to recover the disk.
    http://support.apple.com/kb/TS1417
    To repair your startup drive, you will need to run disk utility from your startup DVD.
    Mac OS X 10.4: About the utilities available on the Mac OS X 10.4 Install DVD
    http://support.apple.com/kb/HT2055
    How to run disk utility from your startup DVD.
    Insert your  startup DVD  into your reader.  Power down your machine.  Hold down to the c key.  Power on your machine.  This will bootup your startup DVD.
    This will bring you to a panel asking you for your language.  Pick your language.
    You you come to the Install Mac OS panel.  Do not install.
    Click on Utilities menu item.  This will give you a pulldown list of utilities.
    Click on the disk utility.
    You are now in disk utility.  Pick your disk.  Click on repair it should be on the lower right of the panel.
    Once the repair completes successfully, you should update your permissions.
    Verify a disk
    As an alternative, you can verify that the filesystem on the disk is correct. You will not be able to repair the file system.
    I suggest that you use disk utility to verify that your startup disk is OK.  Macintosh-HD -> Applications -> Utilities -> Disk Utility  Start up disk utility.  On the left pane view, you will see a list of all your disks.   click on your startup disk.  Click on the First Aid  Tab.  Click on verify.   Hopefully your disk will verify.  If not, you have to boot from your installation DVD and run Disk First Aid from there to attempt to repair your file-system.

  • Can open Topics by drag & drop, but not by double-clicking in the DITA map

    Hi,
    evidently I made an error somewhere in my structure app, the result is that I cannot open DITA topics by double clicking them in the DITA map anymore (Framemaker does simpy nothing). I can, however, open them by dragging the xml files onto the Framemaker window.  If I use the standard DITA 1.2 application everything works fine so I guess the problem is in my mapping.
    Here is what I tried to achieve:
    We need certain variations of the normal 'topic' type topic. The DTD should be identical, however different structures should be auto-inserted when creating a topic and the topic should have certain attribute values predefined.
    The idea is that the author can select one of these topic types when creating a topic, but when opening an existing topic simply edit it with the standard topic temple.
    Here is what I did:
    I duplicated the topic.template.fm, renaming it say "topic_a.template.fm", "topic_b.template.fm" etc. (just an example).
    I made adjustments to the EDD of these templates, changing the auto-insertions and the default values of some attributes.
    In the structapps.fm file I added XML applications for these new topic types, mapping each application to one of the new templates, but to the original topic DTD and r/w rules. E.g. the application "DITA_1.2_topic_a" is mapped to the "topic_a.template.fm" template, and to the original "topic.dtd" and "topic.rules.txt" files.
    In Framemaker I then created corresponding application mappings in the DITA options. E.g. the topic type "A" (which defines the visible text in the "New topic" menu) is maped to the XML application "DITA_1.2_topic_a".
    The result:
    It works as intended in every way when creating topics. The topics are saved with the standard doctype 'topic'. However for when I try to open topics from the DTD by double-clicking then nothing happens. Opening topics by drag & drop works fine though and they are opened with the normal (general) "topic.template.fm" template as desired.
    Any ideas? Was this confusing or am I completely off somewhere?
    Robert

    Hi Robert...
    When you say that you need "variations" from the normal topic type .. are those structural variations or just formatting? FM associates structure apps with XML files based on the doctype (root element). If your files all have the same root element, then they will all open with the same structure application (unless you specify a different one when opening the file or by importing a new EDD). It sounds like you really should be creating a specialization for each alternate topic type. If you don't, you'll end up getting the wrong "model" assigned to the wrong file.
    Multiple EDDs (structure apps) can share the same DTD, and one EDD (structure app) can support multiple models. This is how the "ditabase" app works. There are lots of ways to set this up, but I think what you've done is probably not quite right.
    The default structure app setup in FM11 and FM12 is very complicated to work with. I recommend creating a single app that supports many models. This isn't always possible, but it sounds like in your case it should be. I've set up one app that supports 13 different specialized topic models and it works fine.
    Note that even though you've added structure apps for each model, if you end up opening the files using the default template, you are no longer using those modified models.
    Sorry, but this is a bit more than can be dealt with appropriately in a forum post. If you'd like more help with this, feel free to contact me off list.
    Cheers,
    …scott
    Scott Prentice
    Leximation, Inc.
    www.leximation.com

  • Since upgrading to iTunes 10.5.2 Drag&Drop no longer works in iTunes. Has anyone else experienced this problem?

    When I upgraded to iTunes 10.5.2 I lost the ability to Drag&Drop. I started a new playlist and I could only add songs by cut and paste, and once they were on the list I can’t rearrange them in any other order.

    I realized I can't drag and drop either, but I barely have any songs and I've never noticed if this feature was there before 10.5.2. Is this only on a playlist?

  • Drag & Drop of a file not working in Ubuntu & other linux

    Hi All,
    I am working on a project,in which it has the requirement of dragging the files
    from a JList present inside a JFrame to the desktop.
    First I tried to get a solution using dnd API but could not. Then i googled and i got an application which is
    working perfectly in both Windows and MAC Operating systems, after I made few minor changes to suit my requirements.
    Below is the URL of that application:
    http://stackoverflow.com/questions/1204580/swing-application-drag-drop-to-the-desktop-folder
    The problem is the same application when I executed on Ubuntu, its not working at all. I tried all available options but could not trace out the exact reason.
    Can anybody help me to overcome this issue?
    Thanks in advance

    Hi,
    With the information you provided and through some information found on google i coded an application. This application is able to do the drag and drop of an item from the Desktop to Java application on Linux Platform, but i am unble to do the viceversa by this application.
    I am including the application and the URL of the information i got.
    [URL Of Information Found|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4899516]
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.datatransfer.DataFlavor;
    import java.awt.datatransfer.Transferable;
    import java.awt.datatransfer.UnsupportedFlavorException;
    import java.awt.dnd.DropTarget;
    import java.awt.dnd.DropTargetDragEvent;
    import java.awt.dnd.DropTargetDropEvent;
    import java.awt.dnd.DropTargetEvent;
    import java.awt.dnd.DropTargetListener;
    import java.io.File;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.swing.DefaultListModel;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JScrollPane;
    import javax.swing.SwingUtilities;
    import javax.swing.TransferHandler;
    import javax.swing.WindowConstants;
    public class DnDFrame extends JFrame implements DropTargetListener {
         private DefaultListModel listModel = new DefaultListModel();
         private DropTarget dropTarget;
         private JLabel jLabel1;
         private JScrollPane jScrollPane1;
         private JList list;
         List<File> files;
         /** Creates new form DnDFrame */
         public DnDFrame() {
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              initComponents();
              dropTarget = new DropTarget(list, this);
              list.setModel(listModel);
              list.setDragEnabled(true);
              list.setTransferHandler(new FileTransferHandler());
         @SuppressWarnings("unchecked")
         private void initComponents() {
              GridBagConstraints gridBagConstraints;
              jLabel1 = new JLabel();
              jScrollPane1 = new JScrollPane();
              list = new JList();
              setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              getContentPane().setLayout(new GridBagLayout());
              jLabel1.setText("Files:");
              gridBagConstraints = new GridBagConstraints();
              gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
              gridBagConstraints.anchor = GridBagConstraints.WEST;
              getContentPane().add(jLabel1, gridBagConstraints);
              jScrollPane1.setViewportView(list);
              gridBagConstraints = new GridBagConstraints();
              gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
              gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
              getContentPane().add(jScrollPane1, gridBagConstraints);
              pack();
         public void dragEnter(DropTargetDragEvent arg0) {
         public void dragOver(DropTargetDragEvent arg0) {
         public void dropActionChanged(DropTargetDragEvent arg0) {
         public void dragExit(DropTargetEvent arg0) {
         public void drop(DropTargetDropEvent evt) {
              System.out.println(evt);
              int action = evt.getDropAction();
              evt.acceptDrop(action);
              try {
                   Transferable data = evt.getTransferable();
                   DataFlavor uriListFlavor = null;
                   try {
                        uriListFlavor = new DataFlavor("text/uri-list;class=java.lang.String");
                   } catch (ClassNotFoundException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   System.out.println("data.isDataFlavorSupported(DataFlavor.javaFileListFlavor: " +
                             data.isDataFlavorSupported(DataFlavor.javaFileListFlavor) );
                   if (data.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
                        files = (List<File>) data.getTransferData(DataFlavor.javaFileListFlavor);
                        for (File file : files) {
                             listModel.addElement(file);
                   }else if (data.isDataFlavorSupported(uriListFlavor)) {
                        String data1 = (String)data.getTransferData(uriListFlavor);
                        files = (List<File>) textURIListToFileList(data1);
                        for (File file : files) {
                             listModel.addElement(file);
                        System.out.println(textURIListToFileList(data1));
              } catch (UnsupportedFlavorException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
              } finally {
                   evt.dropComplete(true);
         private static java.util.List textURIListToFileList(String data) {
              java.util.List list = new java.util.ArrayList(1);
              for (java.util.StringTokenizer st = new java.util.StringTokenizer(data,"\r\n");
              st.hasMoreTokens();) {
                   String s = st.nextToken();
                   if (s.startsWith("#")) {
                        continue;
                   try {
                        java.net.URI uri = new java.net.URI(s);
                        java.io.File file = new java.io.File(uri);
                        list.add(file);
                   } catch (java.net.URISyntaxException e) {
                   } catch (IllegalArgumentException e) {
              return list;
         private class FileTransferHandler extends TransferHandler {
              @Override
              protected Transferable createTransferable(JComponent c) {
                   JList list = (JList) c;
                   List<File> files = new ArrayList<File>();
                   for (Object obj: list.getSelectedValues()) {
                        files.add((File)obj);
                   return new FileTransferable(files);
              @Override
              public int getSourceActions(JComponent c) {
                   return COPY;
         static {
              try {
                   uriListFlavor = new
                   DataFlavor("text/uri-list;class=java.lang.String");
              } catch (ClassNotFoundException e) {
                   e.printStackTrace();
         private class FileTransferable implements Transferable {
              private List<File> files;
              public FileTransferable(List<File> files) {
                   this.files = files;
              public DataFlavor[] getTransferDataFlavors() {
                   return new DataFlavor[]{DataFlavor.javaFileListFlavor,uriListFlavor};
              public boolean isDataFlavorSupported(DataFlavor flavor) {
                   if(flavor.equals(DataFlavor.javaFileListFlavor) || flavor.equals(uriListFlavor))
                        return true;
                   else
                        return false;
              public Object getTransferData(DataFlavor flavor) throws
              UnsupportedFlavorException, java.io.IOException {
                      if (isDataFlavorSupported(flavor) && flavor.equals(DataFlavor.javaFileListFlavor)) {
                        return files;
                   }else if (isDataFlavorSupported(flavor) && flavor.equals(uriListFlavor)) {
                        java.io.File file = new java.io.File("file.txt");
                        String data = file.toURI() + "\r\n";
                        return data;
                   }else {
                        throw new UnsupportedFlavorException(flavor);
         private static DataFlavor uriListFlavor;
         static {
              try {
                   uriListFlavor = new
                   DataFlavor("text/uri-list;class=java.lang.String");
              } catch (ClassNotFoundException e) {
                   e.printStackTrace();
         public static void dumpProperty(String name) {
              System.out.println(name + " \t" + System.getProperty(name) );
         public static void main(String[] args) {
              String[] props = {
                        "java.version",
                        "java.vm.version",
                        "java.vendor",
                        "os.name",
              "os.version"};
              for (String prop : props) {
                   dumpProperty(prop);
              Runnable r = new Runnable() {
                   public void run() {
                        DnDFrame f = new DnDFrame();
                        f.setVisible(true);
              SwingUtilities.invokeLater(r);
    }Please Suggest me in this.

  • Tile list - clicking on the images to change get different movies to play

    I am buiding an application where I just got the tile list working with images loaded in.  My question is there a way to click on the images that are loaded in to get them to do things, such as change a video, in my video player?
    Thanks!

    Using the 'adjust date and time' setting is the best way to syncronise the photos from all your cameras. However as you say this merely puts them all in the correct order chronologically.
    If there are photos that you feel would be best somewhere else in an album other than in date order, it may depend on how many as to which is the best option for you. If it's only a few you may wish to adjust the date/time on these few manually so they fit in with the rest where you want them.
    If you have a lot of photos you want in a different order to the order by date, or you really don't care about what date/time is used and just want them in the order you want them in, then 'batch change' is the best option.
    From the view menu, select 'sort photos - manually', drag the photos around until they are in the order you want, select all of them. Now select the batch change option and choose 'Date' from the 'set' options, type in a date and time for the first photo, it can be anything but it's probably a good idea to choose something close to the original date, then check the box 'Add'. You can keep the value set at 1 minute or enter any value you want, it may be more realistic to divide the length of your holiday by the number of photos you have to calculate a value, but it really isn't necessary. Clicking OK will adjust all the dates without affecting the title or description and the photos will now show on the Apple TV in that order.
    Just to be sure iTunes is updated, you may want to go to the advanced menu/choose photos to share in iTunes and deselect the album, apply, reselect the album and apply again.

  • 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);

Maybe you are looking for

  • Problem in sending mail to external id from customer exit

    Hello All, I have a problem that I am sending mail to supervisor. I have written code and it is working correctly in se38 program. This code If I keep in an exit and run tcode then it is not working and it is giving message no mail sent. Why is this

  • Beginner in JNLP

    I want use JNLP with my java application. I've installed Tomcat 5.5, I've make a *.war File of my application and also the *.jnlp file and web.xml file. My question is: How must I install the application into Tomcat and run it from a browser (directo

  • I cannot convert a pdf to work with my newly purchased adobe acrobat pro XI

    i cannot convert a pdf to work with my newly purchased adobe acrobat pro XI

  • Connectivity to ITunes Store

    When I try to log into ITunes Store I get reject stating "could not connect to ITunes Store. Network connection was refused." I have checked out the technical support but nothing seems to work. Any other suggestions?

  • Barge is not working with UCCX 7.1

    Dear EXPERTS, We have CCM 7.1.5 with UCCX 7.1, on CSD the barge is not working, whenever supervisor iniate the barge, his phone start ringing and customer put on hold, he can have conversation with agent only when he is answering his phone. I believe