Conditional dropping with DnD.

I need some help here, please.
I've seen the examples for drag and drop implementations. However most of the implementations that need to do determination of whether the item is droppable assume that you have a reference to the object being transferred.
I my case I am dragging a set of files from the file system to a tree, but they can only be dropped on certain nodes. It seems that you only have the DataFlavors available from the DropTargetDragEvent, but no direct reference to the data. Assuming that .exe files could only be dragged to one type of node, and .bat files to another, how can I make the dragOver methods do the determination against that actual data being transferred as opposed to simple just the type of data?
Any suggestions on this?
Thanks,
Bill

I guess I'm not making my problem clear, or I'm missing something.
The decision is not made simply on the basis of the DataFlavors. Instead it is based on a combination of the DataFlavor, the drag object, and the drop target selection.
Maybe this is a better example.
I want to be able to drag nodes inside of a tree. However the rule is that you can't drop a node onto a child of itself.
In order to evaluate the rule you need to know if the DataFlavor is accepted, AND whether the node we are dragging is a parent of the potential drop node. I can't make this determination without having a reference to the Transferable object being dragged.
Now, I've seen this done in trees where in the drag gesture they cache internally a reference to the node that was selected when the drag gesture was recognized. I could do this, but it seems like a hack to me, as there can be other drag sources where you might still want the same type of drop potential information, such as the native file system, where you don't have access to caching the drag object.
The best solution I have been able to come up with is to create my own "clipboard" type object where I cache the selected node for a drag if the drag originated from the tree. When I recieve dragEvents in the tree of the appropriate data flavor I would go out to the "clipboard" and get the data and use it to see if the drop should be allowed at that point.
What really frustrates me though is that the Transferable object simply isn't available to the DropTargetDragEvent objects. It seems overly simplistic to me to believe that all potiental determinations of the ability to drop something can be made on the DataFlavor alone. The examples even show for checking the data "during" a drop process, but it seems stupid to indicate a drop is acceptable to the user and then fail when they actually try to do the operation.
Bill

Similar Messages

  • How to create conditional drop-down lists

    I would like to create a form that utilizes conditional drop-down selection boxes like at http://blogs.office.com/b/microsoft-excel/archive/2009/11/24/create-conditional-drop-down- lists.aspx
    How can I create a form that contains fields like this?
    Is there a sample I can download?

    I have downloaded the AcroForm version (ListProgramming_Part1_AcroForm.pdf).
    I'm not able to consistently recreate.  I was first playing with the form by selecting values in the drop down.  At one point I went to Document Javascripts and select "Example1".  I chose to edit.  Make no changes and select "OK" I get "SyntaxError: missing } in compound statement 39 at line 40"
    The sec ion of code is:
    function SetPartEntries()
       // Only run this code on when the selection is commited.  
       if(event.willCommit)
          // There are 3 rows in the order form so in order to use other fields in 
          // the same row we first have to acquire the name of the row
          // we are operating on.  This is part of the List field's name, so we 
          // just have to split it off 
          var cRowName = event.target.name.split(".").shift();
          // Now get the new parts list from the Master List
          // Since the selection is being committed, event.value contains the selection text
          var lst = oAssemblyParts[event.value];
          // If an entry is selected that we don't have a parts list for, then
          // the parts list is just cleared. 
          if( (lst != null) && (lst.length > 0) )
             this.getField(cRowName + ".PartSelect").setItems(lst);
          else
             this.getField(cRowName + ".PartSelect").clearItems();
          // We have a new parts lists and the first entry is 
          // is a non-selection.  so clear the price field.
          this.getField(cRowName + ".Price").value = 0;
    I am not able to recreate if I select "Edit all Javascripts" only when I use document javascripts.

  • Conditional drop down list

    Is it possible to create a conditional drop down list using Adobe XI for MAC?  I know I've done this in the past with LifeCycle, but there still appears to be no LifeCycle application for MAC.
    My apologies in advance in the event this post is in duplication...everything I searched in the forum didn't provide me resolution.

    Thank You!  This is exactly what I’m looking for…could you share the ‘how’ behind the if/then statements…I’m using Acrobat XI for MAC and can’t figure out the step by step for completing this task.  I’ve used LifeCycle in the past, but recently transitioned to MAC hardware from WIN and there appears to be no LifeCycle application for MAC.
    Best,
    -emb

  • Is it possible to create a Column with Conditional Mandatory with another Column?

    Is it possible to create a Column with Conditional Mandatory with another Column?
    For example
    In a Table we have column A, B, C.
    A is Primary Column.
    B is Optional
    C is Conditional Mandatory.
    A B
    C
    12345 ABC
    OK
    12346 NULL
    NULL
    12347 ABC
    OK
    Only if the B Column has the value then only C column should be mandatory

    I guess you can't create a condtional mandatory column directly. However, you can use check constraint to on the column
    create table YourTable
      A int primary key,
      B char(3),
      C int,
      constraint ch_con check(
                                B
    is not null
    or C is null

  • [SOLVED] Thunar 1.6 doesn't drag-and-drop with the right mouse button

    Hallo all.
    It might be something I've done (though I did delete my ~/.config/Thunar directory before upgrading), but Thunar doesn't let me drag-and-drop with the right mouse button, thus stopping me from copying something instead of moving it, etc. Has anyone else had that too?
    Last edited by GordonGR (2012-12-28 14:34:20)

    Joel wrote:
    anonymous_user wrote:Is it supposed to be with the right-mouse button? I always thought drag and drop was done with the left button?
    Could be right-hand user
    Come on! Read what GordonGR wrote!
    Microsoft Windows, Nautilus, the Haiku Tracker, and probably many other file managers have a feature where, when you right-click or middle-click and drag an icon to a new location, a pop-up menu appears and asks what you'd like to do (Move, Copy, Link). I thought I used to use this feature in Thunar too but it seems to have stopped working in recent versions. Has anyone else had any experience with it?
    EDIT: Here's random blogger talking about the feature in an older version of Thunar: http://jeromeg.blog.free.fr/index.php?p … and-tricks So that's good, I wasn't just imagining the feature.
    Last edited by drcouzelis (2012-12-12 03:45:05)

  • RE: Drag & Drop with ListView

    By the way, has anyone tried to drag & drop a node from a listview to a
    treeview? I can drag a node from the listview. But when I drop it into
    the treeview, how can I find out which node of the treeview that I drop
    into? Any help will be greatly appreciated.
    Tien Wang
    Indus Consultancy Services
    http://www.indcon.com
    Phone 201.261.3100 x233
    Fax 201.261.1399
    E-mail : [email protected]
    Ulrich:
    Try to change the state of the DVNodeText of the list view to FS_DRAG.
    For example,
    <MyListView.DVNodeText>.state = FS_DRAG. This may solve your problem.
    Hope this helps.
    Tien Wang
    Indus Consultancy Services
    http://www.indcon.com
    Phone 201.261.3100 x245
    Fax 201.261.1399
    E-mail : [email protected]
    -----Original Message-----
    From: owner-forte-users [SMTP:[email protected]]
    Sent: Thursday, October 02, 1997 2:07 PM
    To: 'forte users'
    Subject: Drag & Drop with ListView
    Hi all,
    I am currently implementing a drag and drop between a listview and a
    treeview in Forte 3E.
    The TreeView has an IsDraggable attribute that allows me to drag treeview
    items while also highlighting the selected node. Unfortunately this isn't
    the case with the ListView control. If I put the ListView in a draggable
    state I can't see which node was selected.
    Can anyone supply a solution to draggiing from a ListView while also
    highlighting the node being dragged?
    Ulrich Lalk
    [email protected]

    Ulrich:
    Try to change the state of the DVNodeText of the list view to FS_DRAG.
    For example,
    <MyListView.DVNodeText>.state = FS_DRAG. This may solve your problem.
    Hope this helps.
    Tien Wang
    Indus Consultancy Services
    http://www.indcon.com
    Phone 201.261.3100 x245
    Fax 201.261.1399
    E-mail : [email protected]
    -----Original Message-----
    From: owner-forte-users [SMTP:[email protected]]
    Sent: Thursday, October 02, 1997 2:07 PM
    To: 'forte users'
    Subject: Drag & Drop with ListView
    Hi all,
    I am currently implementing a drag and drop between a listview and a
    treeview in Forte 3E.
    The TreeView has an IsDraggable attribute that allows me to drag treeview
    items while also highlighting the selected node. Unfortunately this isn't
    the case with the ListView control. If I put the ListView in a draggable
    state I can't see which node was selected.
    Can anyone supply a solution to draggiing from a ListView while also
    highlighting the node being dragged?
    Ulrich Lalk
    [email protected]

  • Can't Drag and Drop with a Double Tap using Single Finger in Lion?

    I installed the Mac OS X Lion two days. But I can't drag and drop with a Double tap using Single Finger, which I used to do in Snow Leopard.
    If I choose Three Finger Move, then Swap Between Pages goes back to "Scroll left or right with Two Fingers" that only works with Safari, but doesn't work with Chrome or Firefox.
    I tried literally every setting in Trackpad and also checked if there was a override settings and there is no overrride setting.
    Would be thankful, if you guys could suggest me what to do?
    ======================================
    My Machine Configuration:
    Macbook Pro 13" (mid 2010)
    Intel Core 2 Duo 2.4GHz
    4GB Ram
    Nvidia Geforce 320m
    Mac OS X Lion (Installe on a updated Snow Leopard 10.6.8)

    Hey Serge many thanks for telling me how to do. now its working like previously
    I just cheked the Dragging under Trackpad option and unchecked Three Finger Moves. now I can drag and drop with a double tap using single finger.
    Thank you guys. You are the best

  • Pricing on PO - Condition type with formula

    Dear friends,
    I've one condition type with calculation type (KRECH) set as Formula.
    For the calcutation of this condition I need to set this formula: Value = (Gross Price + Freight) * 0,0035
    Can you please tell me how can I se this condition as required?
    Thanks in advance,
    Afonso Pereira

    Hi
    I have never tried this calculation type - G formula,
    But in the pricing procedure config, there is a field Caclulation type whcih is used as Alternate calculation type.
    You can createa new routine ( nothing but a logic based formula) for caclutaion and assign that to the new condition type.
    This will ensure that if your gross price condition and freight are present then this condition type gets automatically calculated and get populated in the PO conditions.
    For routine creation you need to take help of Abaper.
    Routines are craeted in transaction VOFM
    Thanks & Regards
    Kishore

  • Create condition record with reference to existing condition record

    how to create condition record with reference to existing condition record?

    Hi,
    See this link :
    http://help.sap.com/saphelp_47x200/helpdata/en/de/7a8534c960a134e10000009b38f83b/frameset.htm
    You can create with reference with Tcode : VK14 (or VK34)
    Or in VK12, you can copy condition records with copy rules.
    Regards,
    Lionel

  • VF03: Condition type with no account key is posted to accounting

    Hi,
    I have one condition type JA1Y for which no Account Key is maintained in the pricing procedure.But in VF03 I am able to see JA1Y along with other condition types with account keys.
    Under JA1Y there are 5 line items & I have a message
    "No G/L account found in Account determination type KOFI"
    How can it be possible? How can I avoid this?
    Helpful answers will be rewarded.
    Thanks & Regards
    Swathi

    Hi,
    You have to maintain account determination:
    SPRO -> Sales and Distribution -> Basic Functions -> Account Assignment/Costing -> Revenue Account Determination -> Assign G/L Accounts.
    Here you have different ways of assign an account. Many of them use key account, but others not. Also, you can define your own access sequence.
    Regards.
    Points if it helped you.
    Ángel Rubio.

  • Conditional Branching with quiz slides not working

    Attempting to use conditional branches with quiz slidescauses
    the other quiz slides in my presentation to not work correctly. I
    am attempting to create a 'test-out' pre-quiz for a segment of
    slides in the presentation. I followed the instructions to add
    conditional branching per page 46 of the Breeze Presenter User
    Guide to obviously no avail. Is there a simple straightfoward
    manner in which someone has successfully used conditional branches
    with their quiz slides in their presentation?

    Hi,
    I had the same issue.Apparently as of now PDF templates do not support conditional formatting for XML Publisher.
    See Tim Dexter's response to my query at the bottom of this thread...
    Re: Using the '%' operator in microsoft word template builder for XMLP
    I could get some conditional formatting to work on the pdf template but only for the form field font,size and styles using Javascript, but I don't think there is a way to display values for the form field based on an if condition...
    Lavina

  • Freight condition type-With respect to Delivery Item (per PC)/Volume/Ship-to party 's region

    Hi Gurus,
    I am working on freight related condition type,my requirement is we have to calculate freight cost based on Delivery Item (per PC) / Volume of that Material (Per PC) and Destination Region of each Delivery Order.
    for example:
    If Material '100001' has volume = 1 M3 per PC and Destination region code (in Delivery Order) is '20'. The Freight cost is 1 USD per PC.
    If Material '100001' has volume = 1 M3 per PC and Destination region code is '22'. The Freight cost is 1.5 USD per PC.
    If Material '100002' has volume = 1.5 M3 per PC and Destination region code is '20'. The Freight cost is 2 USD per PC.
    If Material '100002' has volume = 1.5 M3 per PC and Destination region code is '22'. The Freight cost is 3 USD per PC.
    I'm try to set calculation type = 'T - Multi-dimensional' and having 2 Scale Basis as following:
    Scale Basis = 'F - Volume'
    Scale Basis = 'L7 - Region of Destination'
    but it result in error in calculation when creating Shipment cost document. 
    I don't sure whether my understanding on Multi-dimensional scale is correct or not. Please kindly help.
    Thank You in Advance for every idea.

    I think, from your example, if you maintain condition record with the combination of Destination Region Code and Material, it will work, provided, your freight condition type has Calculation Type as "C".
    So your condition record would be
    100001 / 20  =  1USD per PC
    G. Lakshmipathi

  • Error in drag and drop with a Tree component

    Hello, everybody.
    I'm doing a drag and drop with two trees.
    But, when I drag from a tree to another show this error:
    "oracle.job.RowNotFoundException:JBO25020: View line of oracle.jbo.Key[4.4] key not found in ViewTreeNodeRepository13_71."
    Besides that, in my property SelectionListerner, when I have this line: "#{bindings.TreeNodeRepository.treeModel.makeCurrent}" there is a warning that says: "Reference makeCurrent not found".
    Anyone can help me?
    Thanks!

    Hi,
    +Besides that, in my property SelectionListerner, when I have this line: "#{bindings.TreeNodeRepository.treeModel.makeCurrent}" there is a warning that says: "Reference makeCurrent not found".+
    Don't worry, its a designtime warning because the EL cannot be resolved. MakeCurrent is a method on the FacesCtrl binding equivalent to ADF, which is applied at runtime and not available at design time
    +But, when I drag from a tree to another show this error: "oracle.job.RowNotFoundException:JBO25020: View line of oracle.jbo.Key[4.4] key not found in ViewTreeNodeRepository13_71."+
    In drag and drop, ADF Faces performs the drag. However, the rest of the drop handling is up to the developer. Without any more information of what yur drop handler is doing, this question cannot be answered
    Frank

  • How can i pair Air Drop with my iPhone?

    how can i pair Air Drop with my iPhone?

    You can’t until Yosemite comes out; that’ll be sometime this fall, or in the spring for people in the Southern Hemisphere.
    (113743)

  • Pricing - Manual Condition Type with value = 0

    Hi gurus,
    I need to insert a manual condition type with value = 0 into the billing data set.
    I realize that if its valiue is 0 it is not active.
    Anyone knows how to make it active despite its value = 0?
    Thank you.

    Dear Customer,
    if you have customized the condition as price then the condition will be inactive if the condition is set to zero.
    This is calling in:
    LV61AA55                                                                               
    inactivate prices with rate / condition value zero                   
          if xkomv-koaid eq 'B' and xkomv-kbetr eq 0 and komp-kposn ne 0 and 
             xkomv-kgrpe eq ' ' and xkomv-kinak ca ' Y' and xkomv-kwert eq 0 
             and xkomv-kntyp ne 'e' and komp-fareg na '45'.                  
            xkomv-kinak = 'X'.                                               
          endif.                                                             
    If you need an active condition with value zero, then the condition class should not be 'B' (price)
    I hope that the information are helpful.
    regards
    Claudia

Maybe you are looking for