Drag And Drop Element Of Array Of Clusters

I have a project that includes an array of "tests", each of which is a cluster containing an array of "part numbers", a regular expression matching string and an array of "test tasks" (each of which, is in turn, a cluster of elements).
That is:
Tests (array of):
Cluster:
Part Numbers (array of strings)
Regex (string)
Tasks (array of):
Cluster:
Task type
Base Channel,
Measurement Channel
Other Channels
I'd like to be able to drag and drop to re-order the task array within an individual test.  (It's a nice-to-have rather than an urgent request - more for my own learning than anything).  For now, I've implemented "Move Up" and "Move Down" buttons.
The examples are fine for a single cluster that includes an array, or for an array of objects.  As soon as we have an array of clusters, it's hard to access the individual elements within a specific cluster.
Has anybody successfully implemented drag and drop within such a setup?
Curiously,
Geoff
Geoff Field, BE, CLAD, MIEAust
Professional geek, amateur stage-levelling gauge
Solved!
Go to Solution.

Hello GeoffF,
This is definitely doable, and you can even use the standard start drag and drop methods/events, the tricky part is determining the array elements that are being selected on mouse up/mouse down and handling the swap manually.  Luckily, there are a couple decent examples of how to do this out there already, I'd suggest you take a look at this one:
Community Example: Determine Clicked Array Element Index in LabVIEW
https://decibel.ni.com/content/docs/DOC-22434
That should give you the selected array indices, and then all you have to do is switch the elements around around in the drop event.  I've attached a very basic demonstrative example that uses that code I just linked (you'll need to download that as well) and the events mentioned to swap two array elements.   The attached code is just thrown together, you'll want to design something more robust and scalable for any sort of real use.
Regards,
Tom L.
Attachments:
array drag.vi ‏21 KB

Similar Messages

  • Drag and Drop to Change Order in a List

    Does anyone know of an example where there is the ability to drag and drop elements in a list and thus change their order? (I.E. drag item one below item two and then item one and two change locations)
    Thanks!

    Check out http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html
    There's an example towards the end of the page for drag-and-drop between 2 JLists. Might be a good starting point.

  • Drag and drop won't work in application

    Hello,
    I want to drag and drop elements of a listbox to another position inside ob the listbox.
    That works very fine as long as I use LabView during the programming of the VI.
    If I build the VI to a application drag and drop is not working anymore.
    What is the problem?
    Thanks.
    Ronny

    Just hit the bug myself.  Thanks for taking the time to post so I don't have to waste time debugging a know issue.
    Thanks,
    Matt
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

  • Rated drag and drop

    Hello everyone. I apologise for asking a question that has probably been answered previously. I have a dilemma with my animation that I have tried prowling the Internet for for quite some time now and I have yet to find a solution to fit what it is I'm after.
    The animation that I am making in Edge is a drag and drop game which gives students varied results based on how they do. Currently I have the elements dragging and dropping in their correct locations. Once they are in their locations though they do not drag again, making the students have no choice but to get everything correct. After the animation is complete the timeline plays and stops at a marker (Which will be altered based on the answers the students have provided at a later point).
    What I need from this animation is to:
    allow students to drag and drop elements into both correct and incorrect locations.
    to be able to drag them again after placing them.
    to keep a track of the amount of elements that have been dropped.
    I would be incredibly grateful for any comments and feedback on this. I hope I am not the only one who has tried to do this. It feels like I am the only one who is having a problem like this!
    Here is my code currently as well as I am sure I am at least halfway there. The final line (sym.play();) is just for the timeline playing and will change at a later point.
    // insert code to be run when the composition is fully loaded here var dragForms = ['Drag1', 'Drag2', 'Drag3', 'Drag4', 'Drag5']; var dropForms = ['Drop1', 'Drop2', 'Drop3', 'Drop4', 'Drop5']; var Pos = [ {'x':29,'y':115}, {'x':29,'y':160}, {'x':29,'y':205}, {'x':29,'y':250}, {'x':29,'y':295} ]; Pos.sort(function() {return 0.5 - Math.random()}); for (i=0;i

    Hi,
    Excellent helpfull demonstration for dragNdrop.
    I am trying to place if else condition with no success.
    I've changed the code to this
    f
    for (i=0;i<3;i++){
      sym.$(draggableEl[i]).addClass('C');
      sym.$('.C').draggable({
      revert: 'invalid'
      sym.$(droppableEl[0]).droppable({
      accept:'.C',   // use class for accept
      drop: handleDropEvent
    for (i=3;i<6;i++){
      sym.$(draggableEl[i]).addClass('CB');
      sym.$('.CB').draggable({
      revert: 'invalid'
      sym.$(droppableEl[5]).droppable({
      accept:'.CB',   // use class for accept
      drop: handleDropEvent
    and I want:
    if drag fruit with class "C" to basket5
    to alert ("This fruit is for Basket0");
    else if drag fruit with class "C" to basket0
    to alert ("Excellent, Right Basket");
    if drag fruit with class "CB" to basket0
    to alert ("This fruit is for Basket5");
    else if drag fruit with class "CB" to basket5
    to alert ("Excellent, Right Basket");
    How can I done it?
    Can you help me?
    Thank you!

  • I can no longer drag and drop things in Photoshop Elements 12. I can move things with my keyboard, but not my mouse. WHAT IS HAPPENING?!

    When I got Elements 12 (May 2014), I was able to drag and drop things such as cut/pasted items, watermarks, etc. As of 2 weeks ago, I can no longer use my mouse to drag and drop. If I try, it just snaps back wherever it was before I tried to drag it. With that said, the item will move if I use my keyboard. It takes an eternity. WHAT IS GOING ON?! I just really want to use my mouse again...

    Install the 10.10.1 update. That should do it.

  • How do i add photos to the photo array when creating a book using iphoto 8.1.2?  the book doesn't accept the albums and foldlers i drag and drop.

    how do i add photos to the photo array when creating a book using iphoto 8.1.2?  the book doesn't accept the albums and foldlers i drag and drop.

    I'd suggest you ask this question in the iPhoto forums:
    iPhoto
    Posting here is unnecessarily limiting the people who'll see your question to those running iMacs.
    Regards.

  • Drag and drop picture frames in Photoshop Elements 11 from one file to another?

    Hello,
    I am a digital scrapbooker.
    I recently started using Adobe Photoshop Elements 11. I previously had been using Elements 7. I make extensive use of Picture Frames i.e "Basic Black 10px", and in Elements 7, it was very easy to drag and drop a picture frame from one file to another. (I use a separate file for each scrapbook page, and I often move pictures between  pages as I scrap them)
    In Photoshop Elementa 11,  I can drag and drop a picture frame from one file to another, but ONLY if there is no picture in it. If there is a picture, I cannot drag and drop - the circle-slash icon appears showing that it won't land. I was able to do this in Photoshop Elements 7, whether or not there was a picture in the frame.
    Any ideas of what I might be doing wrong, or did Photoshop Elements change this functionality?
    Thank you!

    I think this might be a bug in pse 11, at least on the windows version.
    You might try right clicking on the frame layer in the layers panel, choose Duplicate Frame Layer and pick your other document as the destination.

  • Drag and drop Picasa Album Into Premiere Elements 10

    I tried to drag and drop videos from an album I made in Picasa into Premiere Elements.  No dice.  I tried to drag and drop files from windows explorer into Elements.  No dice.  I have 200 files from various folders all over my machine, assembled in a Picasa album, and I have no way of importing those files into Elements from what I can see.  Anyone know how I can do this?
    I even tried to be clever, grabbing the Picasa XML file that contains the full paths of each file and then creating a space delimited list (with Quotes around each path) and pasting it into the OPEN FILE dialog.  But there seems to be a maximum string length.  No dice.
    Your help would be appreciated.  Thank you in advance.
    Keith

    Yes, the PREL (Project) file is XML, however it is structured for PrE to be able to read (and write) it. If PrE can read the Picasa XML (the structure makes sense to the program), then it just might work.
    Unfortunately, I have never used Picasa, so have no idea of its Album files structures. I also cannot recall anyone mentioning working with it, and PrE, but maybe missed that/those thread(s).
    Other than the general observation, offered above, I have no useful knowledge on what might, or might not work. However, as you experiment, please update this thread, as it might prove very helpful to others - and I get to learn something!!!!
    Good luck,
    Hunt

  • Drag and drop photo in elements 12

    Trying to drag an edited picture from photobin in Elements 12 onto a blank documents. Elements is resizing my photo to fit the blank document. I don't want it to resize. I want to drag and drop multiple photos onto a new blank doument as I have in other versions.

    I suspect you are doing this in the Photo Bin. Do it from the Layers panel (drag the layers you want from each photo to the blank document) and they won't resize (see note).  If you only want a single layer to represent each image either temporarily flatten the image, or use select all and edit> copy merged followed by a paste into the blank document.
    Note: You need to ensure that your image resolutions are consistent across the images, otherwise they will appear as different sizes in the blank document.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children

  • Drag and drop data from Numeric Control or Numeric Array to excel file

    I have two inquirries about drag and drop:
    1. How to drag and drop data from a Numeric Array or Numeric control to excel file
    2. How to drag and drop data from a Numeric Array or Numeric control to an Numeric array Indicator?
    The item 2, I tried it with the event structure, but it didnt work.
    Please do reply.
    mytestautomation.com
    ...unleashed the power, explore and share ideas on power supply testing
    nissanskyline.org
    ...your alternative nissan skyline information site

    There are very good drag and drop examples that ship with LabVIEW.  Have you looked these over to see if they can be modified for your needs?
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

  • Drag and Drop in feature in Tree UI element

    Hello All,
    The requirement is as following. The webdynpro screen should show two nodes Node1 and Node2. Each node would have some attributes.
    Node1           
    __AAA
    __BBB
    Node2
       |__XXX
       |__YYY
    It should  be possible to drag and drop attributes from node to another node(Example , cut YYY from Node2 and add it to Node1).
    Now can we achieve this using Tree UI element? Please let me know your inputs?
    Regards,
    Raghu.

    it should be possible according to sap help[http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a5/bf47414eca430794189fbb5919cc2f/content.htm|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a5/bf47414eca430794189fbb5919cc2f/content.htm]
    Edited by: Baskaran Senthivel on Jan 16, 2012 8:41 PM

  • Drag and drop mapping UI element/functionality

    Hi All,
    we are searching for functionality, in which the UI should contain drag and drop mapping options.
    e.g.
    we have ztableA(cities) containing values:
    NewYork
    London
    Tokyo
    Moscow
    we have ztableB(countries) containing values:
    Russia
    UnitedStates
    Germany
    England
    the UI should contain above two table values vertically (cities on left side, countries on right), and the user should be able to map by dragging and dropping the cities with appropriate countries.
    initially, the screen will look like:
    NewYork     Russia
    London      UnitedStates
    Tokyo       Germany
    Moscow      England
    after drag and drop actions by the user, it will look like:
    NewYork     UnitedStates
    London      England
    Tokyo      
    Moscow      Russia
                Germany    
    after the mapping is saved by the user, i can save the paired values in 3rd ztable.  
    for this UI, how can we achive, are what is the preferred way to get this, using webdynpro abap or fpm or any other?.
    which UI elements we can use. We are on SAP ECC6, EHP7
    thanks in advance.
    Madhu_1980

    Hi,
    You can use Table UI with drag and Drop. create an Event handler for onDrop and read the drag source and drop target then you can append those to new table.
    Drag and Drop - Web Dynpro for ABAP - SAP Library
    Hope this helps u,
    Regards,
    Kiran

  • Element Panel Drag and drop

    I can't seem to be able to drag and drop in the elements panel
    I have to draw a box in something in order to drag something into it

    So you can reorder but you cannot drop a child into a non-parent?
    This is in fact a bug, I'll get it filed for you and worked on.
    Best,
    Corey

  • Drag and drop de index de array

    se puede usar drag and drop en el idex de un array?
    necesito arrastar el valor del index de un array y depositarlo en una celda de una tabla, e intentado con los ejemplos de drag and drop pero no me a funcionado y no se si se p ueda hacer esto en labview 2011.
    si alguien tiene experiencia en estoy y me ayude.
    gracias

    solucionado.
    tuve que identificar el index en la celda del array en que se dio clic y combinarlo con drag and drop

  • Drag and Drop Multiple Pictogram elements from the Palette

    I have created custom Objects in the palette that can drag and drop individual pictogram elements using a class that extends AbstractAddFeature. What I would like to know if it is possible to drag and drop an item from the palette that contains multiple pictogram elements, such as task1, task2 and a connection between them? I cannot do this with my class from above since
    @Override
    public PictogramElement add(IAddContext context) {}
    only returns one PictogramElement.

    Hi,
    In my editor I am adding rectangle with associated label that are separate pictogram elements. However they are both linked to the same business object and more linked to each other.
    Please look at example from my code:
    @Override
    public PictogramElement add(IAddContext context) {
    final Task addedTask = (Task) context.getNewObject();
    final ContainerShape target = context.getTargetContainer();
    final IPeCreateService peCreateService = Graphiti.getPeCreateService();
    final IGaService gaService = Graphiti.getGaService();
    final ContainerShape containerShape = peCreateService.createContainerShape(target, true);
    int width = 0;
    int height = 0;
    width = context.getWidth() <= 0 ? getWidth() : context.getWidth();
    height = context.getHeight() <= 0 ? getHeight() : context.getHeight();
    final Rectangle invisibleRectangle = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(invisibleRectangle, context.getX(), context.getY(), width, height);
    // create and set visible rectangle inside invisible rectangle
    RoundedRectangle roundedRectangle = gaService.createRoundedRectangle(invisibleRectangle, 20, 20);
    roundedRectangle.setParentGraphicsAlgorithm(invisibleRectangle);
    roundedRectangle.setStyle(addedTask.isOnlyLocal() ? onlyLocalStyle : getStyle());
    if(!addedTask.isAtomic()) roundedRectangle.setLineStyle(LineStyle.DOT);
    gaService.setLocationAndSize(roundedRectangle, 0, 0, width, height);
    insertInside(peCreateService, gaService, width, height, containerShape, invisibleRectangle, addedTask);
    ContainerShape labelShape = addLabel(target, addedTask.getId(), width, height, context.getX(), context.getY());
    link(containerShape, new Object[] {addedTask, labelShape});
    link(labelShape, new Object[] {addedTask, containerShape});
    updatePictogramElement(labelShape);
    layoutPictogramElement(labelShape);
    addInternalPorts(addedTask, containerShape);
    updatePictogramElement(containerShape);
    return containerShape;
    I think that linking or making somehow relation between pictogram elements should be enough.

Maybe you are looking for

  • How to Delete Unreaded Document  available in SBWP  (T-Code).

    Dear All, in SBWP (T-Code)  i want to delete Unreaded Documents Please guide me the process. because in unread document 9000 mails are available due to this i am not able to open this screen. and it finally result to  Shot dump : Time_out Error. Plea

  • Multiple process start with terminal?

    How do I open multiple programs at one? I need it to open an executable, leave it running, open another executable. I'm not sure how to do this branch thing in the terminal I want to use this for an .sh script Last edited by caelestis (2009-04-29 22:

  • Authenticate users to production portal system

    At this new installation, portal wants to import roles/users from the production portal system, not prod BW.  Wonu2019t that cause errors for connections with u201Cuse SSO when refreshing reports at view timeu201D?  Note, we havenu2019t set up SNC ye

  • Payment problem/verification problem

    I continue to get the message:  verification required, when I try to purchase a movie on apple TV. I have repeatedly gone back and reset my payment info. All so i just bought a few songs on itunes so there should be nothing wrong with credid card..

  • Help! inserting pdf document

    i'm trying to insert a pdf file in a table i'm not sure about the difference between blob and bfiles. if anybody could help me, it'd be great