Help needed in drag and drop of Flex tree

Hi,
We have an application which allows drag and drop between
multiple
trees and lists.
Here are the steps I follow to refresh on drag and drop:
1. Dispatch a custom event which calls server.
2. On successful response from server I change the model
which is
data provider for the tree.
3. Then, set a flag which triggers 'invalidateDisplayList'
and 'invalidateList' for tree (and other listeners).
4. The tree refreshes fine. But as soon as I drag and drop
between
trees again, I get this error in Tree.as:
TypeError: Error #1010: A term is undefined and has no
properties.
at mx.controls::Tree/::updateDropData()
at mx.controls::Tree/calculateDropIndex()
at mx.controls.listClasses::ListBase/showDropFeedback()
at mx.controls::Tree/showDropFeedback()
The behaviour is weird, sometimes the browser hangs and stops
responding.
I am calling 'contentTree.showDropFeedback(event)' in my
dragOver
event listener which is triggering error.
My tree data provider is a custom class which has 'children'
array
collection attribute.
Any help on how to resolve this issue would be highly
appreciated.
Thanks in advance,
Sujatha

the major restrictions in its implemented only in
jdk1.1.Why!

Similar Messages

  • Help needed in Drag and Drop and  resizing of image icons

    Hi all,
    I'm doing a project on Drag and Drop and resizing of image icons.
    There is one DragContainer in which i have loaded the image icons and i want to drop these image icons on to the DropContainer.
    After Dropping these icons on to the DropContainer i need to resize them.
    I have used the Rectangle object in resizing.
    The problem now i'm facing is when i drag, drop and resize an image icon and when i try to drag, drop a second image icon the first image icon gets erased.
    can any one help me in fixing this error.
    if u want i can provide the source code.
    thanks in advance
    murali

    the major restrictions in its implemented only in
    jdk1.1.Why!

  • Help need in Drag and drop the Lines and rectangle in applet

    hi
    i want to create a simple paint applictaion which is capable of draw lines, rectangle, images etc. after that lines and other thinks can be moveable and rotate and scaling also.
    the major restrictions in its implemented only in jdk1.1.
    so if you people found any solutions or sample codings or application(this one is best) send it to [email protected]
    thanks in advance
    Giri

    the major restrictions in its implemented only in
    jdk1.1.Why!

  • 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

  • Drag and Drop between two trees...

    Hi ,
    Please tell me how to drog and drop from two diffrient trees in a form?
    is the any demo for this one .. please let me know if there..
    thanks in advance
    Mani

    Mani,
    this is not possible. Drag and drop works in client-server and even there you can't drag and drop from one tree to another because a tree is an item on its own. You could decide to build your own tree in a Java Bean and then apply drag and drop to it. Its a non trivial task though.
    Frank

  • Drag and Drop between Flex application

    Hello,
    Can we implement the Drag and Drop functionality between 2
    FLEX applications?
    Each flex application is in its own IE.
    Thank you,
    Thierry

    To my knowledge you can't drag and drop anything between 2
    windows in a browser using any technique in the way that you mean.
    In other words, I don't think you can even do this in javascript
    between 2 windows.
    You can use LocalConnection to simulate this though, by
    having the drag manager notify the other application when it leaves
    the stage, so that when you reach the other application it will
    start the drag effect again in that window.

  • How to drag and drop a sub tree between 2 treeview?

    Suppose I have 2 tree rendered in 2 treeview. Then I want to drag and drop any subtree on any node between the 2 tree.
    For example, in tree 1, if I drag node node1 and drop it on tree 2 node node2. I want all nodes from node1(subtree) moved to node 2 in tree 2.
    How can I do it? Should I code for treeview 1 begindrag event, and code for treeview 2 dragenter event?
    and how to move a sub tree with pb built-in function?

    Hi Kent,
    I have just experimented with drag and drop between treeviews. Below is your bare minimum and caters for one node only. It does not drag any children along. If you drag an item it loses any children. Although it works both ways and within.
    The handle is set in the dragbegin events.
    In the dragdrop events you get source as an argument which is a pointer to the treeview where the drag started.
    You get the node using GetItem ( ref treeviewitem ), then InsertItemSort as a child of the node dropped on.
    NOTE: Must uncheck DisableDragAndDrop property for both treeviews.
    // Instance Variable
    ulong draggedhandle
    type tv_1 from treeview within w_treehop
    string dragicon = "Form!"
    boolean dragauto = true
    boolean disabledragdrop = false
    end type
    event begindrag;
    draggedhandle = handle
    end event
    event dragdrop;
    treeview tvSource
    treeviewitem ltvidropped, ltvidragged
    tvSource = source
    if draggedhandle > 0
      if handle <> draggedhandle or tvSource <> this then
        tvSource.GetItem( draggedhandle , ltvidragged )
        this.GetItem( handle , ltvidropped)
        this.Insertitemsort( handle, ltvidragged )
        tvSource.Deleteitem( draggedhandle )
        draggedhandle = 0
      end if
    end if
    end event
    type tv_2 from treeview within w_treehop
    string dragicon = "Form!"
    boolean dragauto = true
    boolean disabledragdrop = false
    end type
    event begindrag;
    draggedhandle = handle
    end event
    event dragdrop;
    treeview tvSource
    treeviewitem ltvidropped, ltvidragged
    tvSource = source
    if draggedhandle > 0
      if handle <> draggedhandle or tvSource <> this then
        tvSource.GetItem( draggedhandle , ltvidragged )
        this.GetItem( handle , ltvidropped)
        this.Insertitemsort( handle, ltvidragged )
        tvSource.Deleteitem( draggedhandle )
        draggedhandle = 0
      end if
    end if
    end event
    To carry over nested treeview items (children) you can use FindItem ( draggedhandle, navigationcode )
    navigationcode as per help:
         ChildTreeItem! The first child of itemhandle.
         NextTreeItem! The sibling after itemhandle. A sibling is an item at the same level with the same parent.
    HTH
    Lars

  • How to drag and drop nodes in Tree?

    Hi,
    I want to drag and drop nodes in the tree. For example a tree represents the hierarchy of employees reporting in an organization by using tree.I want to change the reporting an employee visible in the tree by simple drag and drop operation in place of going to another form for updating each employee record indiviually.
    Regards
    Piyush

    Ron,
    I looked into implementing drag / drop in one of the apex trees I created today and ran across this thread. Thank you Ron for the links, it helped a lot.
    I added the code below to my page's "Execute when Page Loads" (tree region id is "tree_reg") and the tree is now drag/drop enabled.
    It did break the [+] icon from collapsing the tree though ... but the apex.widget.tree buttons still work
    var regTree = apex.jQuery("#tree_reg").find("div.tree");
    regTree.tree({ 
    callback : {
    onmove: function(NODE, TREE_OBJ, REF_NODE, TYPE)
    {alert(NODE.id+"   "+TREE_OBJ.id+"   "+ REF_NODE);}
    });Next, I plan on creating a AJAX call using NODE.id, TREE_OBJ.id, and REF_NODE
    V/R
    Ricker

  • Drag and drop in ALV tree

    Hi All,
    I have a small requirement, I have to implement drag and drop functionality in ALV ( simple trees ) in such a way that the entire contents ( Folders and its sub folders ) have to be copied. As of now i am able to drag and drop
    one at a time, ie drag and drop  folder and then  again drag and drop its sub folder. Any solution to drag and drop both folder and its sub-folders in one step.
    example program -> rsdemo_drag_drop_tree_multi which allows drag and drop  of folders one at a time.
    Thanks and Regards,
    Kiran.

    Hi ,
    just type BCALV_DND_* in se38 editor and press f4 you will get log of examples for drag n drop funtionality.
    regards
    Ashutosh
    reward points if helpful

  • How do i Drag and drop From one tree to another and vise versa?

    I have two tree structures and i'm trying to drag a leaf of a branch from one tree to another and vise versa. i'm using flex 3 to code it. I'm also trying to put a prevention on dropping a leaf of one tree from being dropped inside a branch of another tree. Anything that is dragged over to another tree should be placed as a dangling node in that tree. Please share this code and help me find a solution.
    <?xml version="1.0" encoding="utf-8"?><mx:Application 
    xmlns:mx="
    http://www.adobe.com/2006/mxml" xmlns:comp="
    com.adobe.flex.extras.controls.*" initialize="data2
    new
    ArrayCollection(countries);"layout="
    absolute"verticalAlign="
    middle" backgroundColor="white" height="
    551">
    <mx:Script>
    <![CDATA[
    importmx.events.FlexEvent; 
    importmx.collections.ArrayCollection; 
    importmx.controls.Alert; 
    importmx.events.DragEvent; 
    importmx.managers.DragManager;  
    importmx.core.DragSource;  
    importmx.core.UIComponent;  
    importmx.controls.Tree;  
    // data provider for role name[
    Bindable] private vardata2: ArrayCollection; 
    // variable to store the node that is dragged from a tree 
    private var draggedItemOfAccessTree:XML = null;  
    private var draggedItemOfExclusionTree:XML = null; 
    private var dragItemAccess:DisplayObject =null; 
    private var dragItemExclusion:DisplayObject =null; 
    // Array to store the Role list[
    Bindable]public varcountries: Array = [{id: 0, name:
    "Role 1"},{id: 1, name:
    "Role 2"},{id: 2, name:
    "Role 3"},{id: 3, name:
    "Role 4"},{id: 4, name:
    "Role 5"},{id: 5, name:
    "Role 6"},{id: 6, name:
    "Role 7"},{id: 7, name:
    "Role 8"},{id: 8, name:
    "Role 9"},{id: 9, name:
    "Role 10"},{id: 10,name:
    "Role 11"} 
    // this event is called when we begin dragging a node in a tree 
    private function onAccessListDragEnter( event:DragEvent ) : void{
    event.preventDefault();
    vards1:DragSource = event.dragSource;  
    var items1:Array = ds1.dataForFormat("treeItems") asArray; 
    if (items1 != null && items1.length > 0 && (items1[0] isXML)){
    draggedItemOfAccessTree = items1[0];
    dragItemAccess = items1[0]
    asDisplayObject;}
    DragManager.acceptDragDrop(UIComponent(event.currentTarget));
    private function onExclusionListDragEnter( event:DragEvent ) : void{
    event.preventDefault();
    vards2:DragSource = event.dragSource;  
    var items2:Array = ds2.dataForFormat("treeItems") asArray; 
    if (items2 != null && items2.length > 0 && (items2[0] isXML)){
    draggedItemOfExclusionTree = items2[0];
    dragItemExclusion =items2[0]
    asDisplayObject;}
    DragManager.acceptDragDrop(UIComponent(event.currentTarget));
    private function onAccessListDragOver( event:DragEvent ) : void{
    event.preventDefault();
    varvar1:Number = AccessTree.selectedIndex; 
    varvar2:Number = ExclusionTree.calculateDropIndex(event);  
    var node1:XML = AccessTree.selectedItem asXML;  
    var node2:XML = ExclusionTree.calculateDropIndex(event) asXML;  
    //restrict drag & drop to nodes within same parent  
    if(draggedItemOfAccessTree.parent() == node1.parent() || draggedItemOfAccessTree.parent() != node1.parent()){
    DragManager.showFeedback(DragManager.NONE);
    //return; }
    elseDragManager.showFeedback(DragManager.MOVE);
    private function onExclusionListDragOver( event:DragEvent ) : void{
    event.preventDefault();
    varvar1:Number = ExclusionTree.selectedIndex;  
    varvar2:Number = AccessTree.calculateDropIndex(event); 
    var node1:XML = AccessTree.calculateDropIndex(event) asXML;  
    var node2:XML = ExclusionTree.selectedItem asXML;  
    //restrict drag & drop to nodes within same parent  
    if( draggedItemOfExclusionTree.parent() == node2.parent() || draggedItemOfExclusionTree.parent() != node2.parent()){
    DragManager.showFeedback(DragManager.NONE);
    // return; }
    elseDragManager.showFeedback(DragManager.MOVE);
    private function onAccessListDragDrop( event:DragEvent ) : void{
    event.preventDefault();
    varSindex:Number = AccessTree.selectedIndex; 
    varEindex:Number= ExclusionTree.calculateDropIndex(event);  
    var Enode:XML = ExclusionTree.selectedItem asXML;  
    var Anode:XML = AccessTree.selectedItem asXML; 
    if((draggedItemOfAccessTree.parent() != Anode.parent()) ){
    AccessTree.removeChildAt(Sindex);
    ExclusionTree.addChildAt(dragItemAccess , Eindex);
    // AccessTree.rdataDescriptor.removeChildAt(Anode.parent(),draggedItemOfAccessTree,Sindex);  
    //ExclusionTree.dataDescriptor.addChildAt(Enode.parent(),draggedItemOfAccessTree,Eindex); }
    private function onExclusionListDragDrop( event:DragEvent ) : void{
    event.preventDefault();
    varEindex:Number = ExclusionTree.selectedIndex; 
    varSindex:Number = AccessTree.calculateDropIndex(event);  
    var Anode:XML = AccessTree.selectedItem asXML;  
    var Enode:XML = ExclusionTree.selectedItem asXML; 
    if((draggedItemOfExclusionTree.parent() != Enode.parent()) ){
    ExclusionTree.removeChildAt(Eindex);
    AccessTree.addChildAt(dragItemExclusion, Sindex);
    // ExclusionTree.dataDescriptor.removeChildAt(Enode.parent(),draggedItemOfExclusionTree,Eind ex);  
    // AccessTree.dataDescriptor.addChildAt(Anode.parent(),draggedItemOfExclusionTree,Eindex); }
    private function onDragComplete( event:DragEvent ) : void

    Yes, I have set dragEnabled and dropEnabled to true. I trying to put restriction on dropping the node(aka leaf) of 1st free tree inside the branch(aka folder) of the 2nd tree. If something is dragged from tree1, it should be dropped only on tree2  i.e., dragged node should be appended at the end of tree2 and not inside nay of the branches of tree2. This functionality should work on both the trees. I'll be glad if u can provide the solution.

  • Drag and drop in a tree

    Hello ,
    I have a column tree (CL_GUI_COLUMN_TREE) and want to sort nodes within this tree by drag & drop.
    (Like in the favorites menu SAP Easy Access)
    Has anyone a sample report for this?
    thank you in advance.
    Werner

    HI,
    Look at this URL, you will get all types of ALV Tree  reprots
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree.htm
    Regards
    Sudheer

  • Tutorial: Flex Drag and Drop

    I have just published a tutorial on Drag-and-Drop in Flex:
    http://www.flexafterdark.com/tutorials/Flex-Drag-and-Drop
    I hope it is helpful and would certainly appreciate any feedback you are willing to share.
    Thank you.
    Ben Edwards

    Ben, I have a Drag & Drop related question. Please see:
    http://forums.adobe.com/thread/534259?tstart=0
    Thanks.

  • Drag and Drop using Components[

    Hi,
    As anyone used Drag and Drop for components? I mean, allowing the user to drag and drop a component around a container? Just curious, so far from what I've seen, the only things that can be dragged/dropped are properties of a given object, such as 'text" from a JLabel.
    thanks

    IMHO, you don't need fancy drag and drop features to do that. Implementing MouseInputListener and listening for mouseDragged is a good start. Then setting the component's bounds depending on the location of the mouse at the mouseReleased event (wrt the starting offset) could be a good idea (if you're using absolute positioning, of course).
    From there, it all depends on what you want it to look like during the "transfer". You could, for instance paint the component in a BufferedImage at the start of the D&D and then paint the image with transparency as the mouse is moving.
    Camickr had an interesting post that might help you :
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=492100

  • Drag and drop the xml schema?

    hi all
    i am creating a GUI. i am using splitpane to split my Frame. and my left split pane contains the XML schema in the form of a JTree. and i need to drag and drop the nodes of a JTree on to right split pane which sub divided in to some regions. i can able to open the xml file in to left split pane as a Jtree. but unable to drag and drop the Nodes in to rightsplit pane.
    any e book or sample code is greatly appriciated.
    thanks in advance.
    karthik

    Hi
    I am new to Oracle but not to VS. I have downloaded and installed the newest tools for Developer, having first tried the install for VS2003.net (which refused to install on my VS 2005.) I got the beta download and installed it, but my oracle explorer shows nothing. Any attempt to add a connection results in an error ORA-12560:TNS:protocol adaptor error. I had the full install of 10g r2 on my notebook, but removed it and opted for the XE version. I removed the Oracle_Home environment variable prior to installing XE. I am trying to connect to the HR database, and the account is unlocked. I saw a reference to the tnsfiles file, and that seems to be the problem, but I don't know what to do about it. Thanks in advance to anyone who can offer help.
    Bruce
    [email protected]

  • About Dragging  and Dropping

    1-> I need to drag and drop a whole row or column within a same table.
    how would i accomplish this in an applet.
    2-> And also how can i store users personal table setting, so that next time when user logs in he can have the same view of the table.
    Please help !
    Thanks

    i solved the problem my self. not very solid solution but it works fine.
    t.addMouseListener( new MouseListener() {
              public void mouseClicked(MouseEvent e) {
              public void mousePressed(MouseEvent e) {
                   Point p = e.getPoint();
                   copyIndex = t.rowAtPoint(p);
                   System.out.println("row from : "+copyIndex);
                   stopThread();
              public void mouseReleased(MouseEvent e) {
                   Point p = e.getPoint();
                   pasteIndex = t.rowAtPoint(p);
                   System.out.println("row to : "+pasteIndex);
         //Swapping rows value manually
                   String temp[]=new String[colSize+1];
                   for(int i=0;i<temp.length;i++)     
                   {temp[i]=(String)t.getValueAt(pasteIndex,i);}
                   for(int i=0;i<temp.length;i++)     
              { t.setValueAt(t.getValueAt(copyIndex,i),pasteIndex,i); }
              for(int i=0;i<temp.length;i++)     
                   { t.setValueAt(temp[i],copyIndex,i); }
         //sending temporary row arrangement to servlet to get it permanent
                   String rowArrangement="";
                   for(int i=0;i<recSize;i++)
                        {  rowArrangement=rowArrangement+(String)t.getValueAt(i,0)+"*"; }
                   try{     
                        wheretogo=1;
                   AppletContext ac=getAppletContext();
                        URL url=getCodeBase();
                        ac.showDocument(new URL(url+"SaveRowArrangementServlet?Arrange="+rowArrangement));
                        }catch(Exception ex) {System.out.println(ex);}
              public void mouseEntered(MouseEvent e) {}
              public void mouseExited(MouseEvent e) {}
              );

Maybe you are looking for