AF:tree Drag and Drop NPE problem

Hello. I use JDeveloper 11.1.2.4.0.

I have a tree composed of 4 levels (in a page template). I had an obligation of implementation of slip and fall on the shaft to allow movement of the nodes of level down a penultimate node to another. Looking around for suitable examples, I followed the example here - http://www.gabrielsideras.com/2010/10/23/adf-drag-and-drop-functionality-in-an-aftree-component/

I had to introduce the penultimate node in the tree by adding a view accessor of additional link and makes appear only in the binding of the tree. The component af:tree itself is configured with a nodestamp containing a faceted af:switcher and child for the value of def relevant structure. Selected and disclosed RowKeys are maintained at the level of the session for the tree through controlled beans. Note that all objects referenced in the tree view have defined primary keys.

When try to drag-and-drop, however, I get the following message appears in the console, immediately followed by a (below battery) Null pointer Exception:

< UIXInclude > < _warnUnpoppedContextChanges > ADF_FACES-10021: during treatment of the include element, the change of context found does not match the component of the current. Should oracle.adf.view.rich.component.fragment.UIXInclude$ IncludeContextChange, but had UIXCollection.CollectionComponentChange [Component class: oracle.adf.view.rich.component.rich.data.RichTree, the component ID: pt_t2].

< UIXInclude > < _warnUnpoppedContextChanges > ADF_FACES-10021: during treatment of the include element, the change of context found does not match the component of the current. Should oracle.adf.view.rich.component.fragment.UIXInclude$ IncludeContextChange, but had UIXCollection.CollectionComponentChange [Component class: oracle.adf.view.rich.component.rich.data.RichTree, the component ID: pt_t2].

Then the stacktrace


java.lang.NullPointerException
  at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.findChildNode(JUCtrlHierNodeBinding.java:879)
  at oracle.jbo.uicli.binding.JUCtrlHierBinding.bringNodeToRangeKeyPath(JUCtrlHierBinding.java:788)
  at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding.bringNodeToRangeKeyPath(FacesCtrlHierBinding.java:111)
  at oracle.adfinternal.view.faces.model.binding.RowDataManager.setRowKey(RowDataManager.java:130)
  at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.setRowKey(FacesCtrlHierBinding.java:830)
  at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:513)
  at org.apache.myfaces.trinidad.component.UIXCollection.invokeOnComponent(UIXCollection.java:1220)
  at oracle.adf.view.rich.component.rich.data.RichTree.invokeOnComponent(RichTree.java:439)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at oracle.adf.view.rich.component.fragment.UIXInclude.invokeOnComponent(UIXInclude.java:161)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXDocument.invokeOnComponent(UIXDocument.java:106)
  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1321)
  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:678)
  at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$DeliverDropTargetDropEvent.invokeContextCallback(LifecycleImpl.java:1711)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1735)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXCollection.invokeOnComponent(UIXCollection.java:1215)
  at oracle.adf.view.rich.component.rich.data.RichTree.invokeOnComponent(RichTree.java:439)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at oracle.adf.view.rich.component.fragment.UIXInclude.invokeOnComponent(UIXInclude.java:161)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
  at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
  at org.apache.myfaces.trinidad.component.UIXDocument.invokeOnComponent(UIXDocument.java:106)
  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1321)
  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:678)
  at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeCustomEvents(LifecycleImpl.java:553)
  at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:431)
  at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
  at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
  at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
  at we  blogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
  at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at cognitmmon.helper.SessionTimeOutListener.doFilter(SessionTimeOutListener.java:85)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
  at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
  at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
  at java.security.AccessController.doPrivileged(Native Method)
  at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
  at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
  at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
  at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
  at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
  at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
  at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
  at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
  at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
  at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
  at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
  at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
  at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

Once the error has been handled, navigating to a page that contains the model shows that the displacement of the node successfully.

Initially, I assumed that it's something to do with an inconsistency in the scope of the session RowKeySets. I removed this dependency, but also an attempt to refresh the nodes of tree programmatically (by running queries on the link accessors see) but none of this had no effect...

I guess I'm not at all clear how ADF manages the change of key values when a node is moved between nodes parents in this way...?

Any help would be much appreciated - as usual, I'm not 100% sure what level of detail should be described here then please let me know if there are some info.

Thank you.

A quick update. I solved the problem I've done myself...

The dropListener code was not reset the currency of the line to the original in the tree rowKey when I finished to retrieve info from the drop site and drag the source (transferable).

Thanks for your help anyway.

Tags: Java

Similar Questions

  • [Request] Drag and drop the problem

    Untitled2.png

    Hello everyone, I am a new Member here, and I just installed Adobe Flash Professional CS6 on my computer. I want a simple quiz with drag and drop a feature inside. I want to drag the squares marked a (Square_1) since the first position with 'STAR' in the white square (Target_1), I already dropped the script, but whenever I leave A square on the white square (Target_1), it does not precisely on the white square (Target_1). I use this script to drag and drop with the target job:

    var startX:Number;
    var startY:Number;
    
    Square_1.addEventListener(MouseEvent.MOUSE_DOWN, pickMe);
    Square_1.addEventListener(MouseEvent.MOUSE_UP, dropMe);
    
    function pickMe(event:MouseEvent):void {
        event.target.startDrag(true);
        startX = event.target.x;
        startY = event.target.y;
    }
    function dropMe(event:MouseEvent):void {
        event.target.stopDrag();
        var myTargetName:String = "target" + event.target.name;
        var myTarget:DisplayObject = getChildByName(myTargetName);
        if (event.target.dropTarget != null && event.target.dropTarget.parent == Target_1){
            event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickMe);
            event.target.removeEventListener(MouseEvent.MOUSE_UP, dropMe);
            event.target.buttonMode = false;
            event.target.x = Target_1.x;
            event.target.y = Target_1.y;
    
        } else {
            event.target.x = startX;
            event.target.y = startY;
        }
    
    }
    
    

    Any help would be appreciated. Thank you.

    If has and that white square was all colon reg, in their centers, or both upper-left you wouldn't have a problem.  as it is with the white square with upper left reg and has with dot central reg, you can use:

    event.target.x = Target_1.x+Target_1.width/2;
            event.target.y = Target_1.y+Target_1.height/2;

    but it would be better to use reg consistent throughout your application.

  • TileList drag and drop proxy problem

    I'm doing an image gallery using a TileList component with drag and drop support. I want my proxy drag not just red with a transparent background (only image) and not image with the container that you can see in this screenshot:

    sample.png

    But that's how it should look:

    sample2.png

    How can I achieve this?

    Here is the source code:

    http://www.2shared.com/file/WPExMzvz/DanDCanvas.html

    It seems to me that you are using a Flex with an Image container as your itemRenderer. Really, this is not a good practice because the containers are heavy and you will cause performance problems.

    If you only view the images, you must use the Image as your itemRenderer. Then, when you drag one of the points, you will only get the container with a scroll bar. The image may still have a background and not be transparent, however.

    Joan

  • Drag and drop the problem in the card game

    Hello world

    I'm trying to adapt the game memory in Chapter 3 of the "ActionScript 3.0 Game Programming University" book for my own use. I want to get all the cards to flip and drag. I am able to return the first card and drag it, but when I return the second card, I can't drag. I have two files, MatchingGameMe.fla and MatchingGameMe.as. All the actionscript code is in MatchingGameMe.as. Here's the code. Did anyone see how I can change so that all the cards slide? Thank you in advance for your help!

    MemoryGameMe.as:


    package {}
    import flash.display. *;
    import flash.events. *;

    SerializableAttribute public class MatchingGameMe extends MovieClip {}
    game constants
    private static const boardWidth:uint = 6;
    private static const boardHeight:uint = 6;

    boardOffsetX:Number private static const is 120;.
    boardOffsetY:Number private static const is 45;.

    private var firstCard:Card;
    private var secondCard:Card;

    public void MatchingGameMe (): void {}
    Make a list of card numbers
    var cardlist:Array = new Array();
    for (var i: uint = 0; i < boardWidth * boardHeight/2; i ++) {}
    CARDLIST.push (i);
    CARDLIST.push (i);

    }

    create all the maps, their position and assign a randomcard to each
    for (var x: uint = 0; x < boardWidth; x ++) {/ / horizontal}
    for (var y: uint = 0; y < boardHeight; y ++) {/ / vertical}
    var c:Card = new Card(); copy the clip
    c.Stop (); stop on the first frame

    var r: uint = Math.floor (Math.random () * cardlist.length); get a random face
    c.cardface = cardlist [r]; assign to the map
    CARDLIST.splice (r, 1); Remove the face of list
    c.addEventListener (MouseEvent.CLICK, clickCard); have it listen to the clicks
    addChild (c); Show the map

    This function is called when the mouse button is pressed.
    function startDragging(event:MouseEvent):void
    {
    c.startDrag ();
    }

    This function is called when the mouse button is released.
    function stopDragging(event:MouseEvent):void
    {
    c.stopDrag ();
    }

    c.addEventListener (MouseEvent.MOUSE_DOWN, startDragging);
    c.addEventListener (MouseEvent.MOUSE_UP, stopDragging);

    }
    }
    }

    clicking on a card reader
    public void clickCard(event:MouseEvent) {}
    var thisCard:Card = (event.target as card); What card?
    firstCard = thisCard; It notes
    firstCard.gotoAndStop(thisCard.cardface+2); Return it

    }
    }

    }

    Don't know if it will work within the classes, but working with AS3, this type the command to oppose you just clicked, and the object you just dropped:

    // This function is called when the mouse button is pressed.
       function startDragging(event:MouseEvent):void
       {
            event.currentTarget.startDrag();
       }
    
        // This function is called when the mouse button is released.
        function stopDragging(event:MouseEvent):void
       {
           event.currentTarget.stopDrag();
       }
    
  • I have problems with gmail with firefox. Refreshing page is slow; Drag and drop files in email sometimes do not work.

    My problem is mainly associated with gmail. When I click on return to the Inbox after reading a mail, it takes a good few seconds while in the past, it was always instant.

    My other problem is drag them / move the files as an attachment in gmail. Sometimes it won't work and I have to use the manual icon attaches trombone. However, if I restart firefox and re - connect to gmail, it will work again.

    I also noticed that when you drag an image in the mail window, it will not become an attachment, but it will appear instead. Is there a way where I can choose to have inserted images as attachments rather than displayed in the mail?

    Thanks for any advice you can give me.

    Hi Guigs2,

    Thanks for your advice. I'm not sure what will happen if I change my profile. I'm afraid I'll be somebody else for those who know me.

    So I decided to try the second option on the plugin check. After I clicked on the link the message says that my version of firefox is not the last. I've updated it and so far I don't have drag and drop the problem but we will give it some time and see. This problem does not occur all the time but it happened a few times, so I guess I should try it for a while.

    Thanks a lot for your advice

  • Tree manual Drag and drop

    I'm trying to implement a tree with drag and drop functionality that:
    1. does not allow a file/branch to drag in a different folder/line
    2. does not allow a branch not to drag onto a branch and in the root

    Basically, I'm trying to preserve a State that looks like this:

    Folder
    -Node
    -Node
    -Node
    Folder
    -Node
    -Node
    ...

    I want the user to be able to reorganize files by drag and drop, nodes of exchange between files and rearrange nodes in the files, but nothing else.

    For this I implement a manual drag and drop in who I am calculating the index from falling as follows:

    var int index = this.calculateDropIndex (event);

    The problem is that falling is the same for both situations which would drop different results:
    1. when the clogging indicator immediately prior to a folder
    2. when the clogging indicator is just above (to the right in the Center) of an open empty folder

    In the first case, I would like to manually add the point * somewhere above * the file (index) in the tree and in the second case, I want to place the element slipped * inside * the file.

    Is it possible that I can tell the difference between these two cases. Any help would be GREATLY appreciated. Thank you!

    Well, I found something that works and it has not even force me to abandon the automatic brake and drop the control functionality (even if I don't know that it belongs to the category "shameless hack").

    The method calculateDropIndex() in the class Tree gets its data from the _dropData of the class member. _dropData.parent contains the item - in my case XML - index that points to the dropIndicator. If it is null, I know that the dropIndicator lies at the root and in my case, it is enough information. I access it from my long MXML tree as follows:

    This.mx_internal::_dropData

    Hopefully this quick fix can be useful to someone.

  • In ADF how drag and drop onto a tree to another tree node

    Hi all

    Can all give examples of code, or tree of ways to drag and drop nodes from one tree to another tree.

    Here the drag source is tree and the target is also tree, it should allow me to slip and fall of the scale of the tree.

    Thank you

    Srikanth

    To be passed to af:tree consult

    Drop trees

  • Problem with drag and drop multiple lines of ListView

    I work on an example application with 2 views of list that is the players and the team and implement drop and drop as players can be deposited to one list to the other. Everything works as expected when there is selection unique model is enabled in the source list view. However, if I have activated several model selection and drag 2 or more lines of source target list view list view, see the following exception after that the decline is over.

    Exception:

    java.lang.IllegalArgumentException: only objects serializable or ByteBuffer can be used as data with the format of data [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 to be able to drag and drop multiple lines? Looks like we don't have for the type of object, so I created the following which does not solve the problem.

    private DataFormat dataFormat = new DataFormat ("subListPlayers");

    (2) I made changes to support serialization on the data object that seems no more to solve the problem. Tried by implementing the interface Serializable, as well as the implementation of the Externalize interface.

    Can someone Guide please if there is an easy way to implement this behavior?

    Code:

    
    

    public class player

    {

    private String name;

    public player (String name)

    {

    myIdName = name;

    }

    public String getName()

    {

    return the name.

    }

    public void setName (String name)

    {

    myIdName = name;

    }

    @Override

    public boolean equals (Object o)

    {

    If (this == o) return true;

    If (o == null | getClass()! = o.getClass ()) return false;

    A player = o (player);

    If (name! = null? name.equals (player.name): player.name! = null) return false;

    Returns true;

    }

    @Override

    public int hashCode()

    {

    return the name of! = null? name.hashCode (): 0;

    }

    }

    SerializableAttribute public class JavaFXDnDApplication extends Application

    {

    private final static ListView < drive > playersListView = new ListView < drive > ();

    private final static ObservableList < drive > /playerslist is FXCollections.observableArrayList ();.

    private final static ListView < drive > teamListView = new ListView < drive > ();

    private final static GridPane rootPane = new GridPane();

    private DataFormat dataFormat = new DataFormat ("subListPlayers");

    Public Shared Sub main (String [] args)

    {

    Launch (args);

    }

    @Override

    public void start (point primaryStage)

    {

    primaryStage.setTitle ("Drag and Drop Application");

    initializeComponents();

    initializeListeners();

    buildGUI();

    populateData();

    primaryStage.setScene (new scene (rootPane, 400, 325));

    primaryStage.show ();

    }

    Private Sub initializeListeners()

    {

    playersListView.setOnDragDetected (new EventHandler < MouseEvent >)

    {

    @Override

    public void handle (event MouseEvent)

    {

    System.out.println ("setOnDragDetected");

    Dragboard dragBoard = (TransferMode.MOVE) playersListView.startDragAndDrop;

    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 < drive > drive = dragEvent.getDragboard () .getContent (dataFormat) (< drive > ObservableList);

    String player = dragEvent.getDragboard () .getString ();

    teamListView.getItems () .addAll (New Player (player));

    playersList.remove (new Player (player));

    dragEvent.setDropCompleted (true);

    }

    });

    }

    Private Sub 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 Sub populateData()

    {

    () playersList.addAll

    New Player("Adam"), New Player("Alex"), Player ("Alfred") New Player("Albert") new,.

    New Player("Brenda"), New Player("Connie"), Player ("Derek") new new Player ("Donny").

    Player ("Lynne") new, New Player ("Myrtle"), Player ("pink") New Player("Rudolph") new,.

    Player("Tony") new, New Player ("Trudy"), Player ("Williams") New Player ("Zach") new

    );

    playersListView.setItems (playersList);

    }

    Private Sub initializeComponents()

    {

    playersListView.setPrefSize (250, 290);

    playersListView.setEditable (true);

    playersListView.getSelectionModel () .setSelectionMode (SelectionMode.MULTIPLE);

    playersListView.setCellFactory (new reminder < < drive > ListView, ListCell < drive > > ())

    {

    @Override

    public call for ListCell < drive > (ListView < drive > playerListView)

    {

    return again ListCell < drive >)

    {

    @Override

    protected void updateItem (player, boolean b)

    {

    super.updateItem (reader, b);

    If (player! = null)

    {

    setText (player.getName ());

    }

    }

    };

    }

    });

    teamListView.setPrefSize (250, 290);

    teamListView.setEditable (true);

    teamListView.getSelectionModel () .setSelectionMode (SelectionMode.MULTIPLE);

    teamListView.setCellFactory (new reminder < < drive > ListView, ListCell < drive > > ())

    {

    @Override

    public call for ListCell < drive > (ListView < drive > playerListView)

    {

    return again ListCell < drive >)

    {

    @Override

    protected void updateItem (player, boolean b)

    {

    super.updateItem (reader, b);

    If (player! = null)

    {

    setText (player.getName ());

    }

    }

    };

    }

    });

    }

    }

    
    

    Yes, it is a pain. I filed https://javafx-jira.kenai.com/browse/RT-29082 earlier. Go ahead and vote in favour if you're inclined...

    I think that the problem in your case, it is the observable list provided by MultipleSelectionModel.getSelectedItems () is not serializable. So even if you make your player Serializable class, the list is not. The first thing I would try, I think, is to make player implements Serializable and pass in an ArrayList instead of the observable list. If you can do

    content.put(dataFormat, new ArrayList(playersListView.getSelectionModel().getSelectedItems()));
    

    and

    List player = (List) dragEvent.getDragboard().getContent(dataFormat);
    teamListView.getItems().addAll(player);
    

    If it does not, a solution is simply to store the "slipped" into a property list:

    final ListProperty draggedPlayers = new SimpleListProperty();
    //...
    // 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);
    }
    
  • problem with drag and drop

    Hi I have a problem with drag and drop I have 2 clip and I have 2 target, I want when I drag the clip 1 to 1, target 1 to target not accepts the clip2, clip 2 can therefore be enjoy to target 2. (target 1 can accept clip 1 and clip 2, target 2 can also clip accepts 1 & 2)

    Stone

    clip_piere.addEventListener (MouseEvent.MOUSE_DOWN, dep_piere);

    clip_piere.addEventListener (MouseEvent.MOUSE_UP, arreter_piere);

    clip_piere.buttonMode = true;

    var x_piere, y_piere:Number;

    x_piere = clip_piere.x;

    y_piere = clip_piere.y;

    function dep_piere(event:MouseEvent):void

    {

    clip_piere.StartDrag ();

    }

    function arreter_piere(event:MouseEvent):void

    {

    If (place1.hitTestObject (clip_piere): place2.hitTestObject (clip_piere)) {}

    clip_piere.stopDrag ();

    clip_piere. RemoveEventListener (MouseEvent.MOUSE_DOWN, dep_piere);

    } else {}

    clip_piere.x = x_piere;

    clip_piere.y = y_piere;

    clip_piere.stopDrag ();

    }

    }

    EAN

    clip_ean.addEventListener (MouseEvent.MOUSE_DOWN, dep_ean);

    clip_ean.addEventListener (MouseEvent.MOUSE_UP, arreter_ean);

    var x_ean, y_ean:Number;

    x_ean = clip_ean.x;

    y_ean = clip_ean.y;

    function dep_ean(event:MouseEvent):void

    {

    clip_ean.StartDrag ();

    }

    function arreter_ean(event:MouseEvent):void

    {

    If (place1.hitTestObject (clip_ean): place2.hitTestObject (clip_ean)) {}

    clip_ean.stopDrag ();

    clip_ean. RemoveEventListener (MouseEvent.MOUSE_DOWN, dep_ean);

    } else {}

    clip_ean.x = x_ean;

    clip_ean.y = y_ean;

    clip_ean.stopDrag ();

    }

    }

    Here is a link to a file that I did for you based on your objects and what I described in my last answer.  I reduced the code so that the
    the objects share the same functions.  I moved the MOUSE_UP listener on stage so that it is less prone to failure should drag you the object when slide it / drop.

    http://www.nedwebs.com/Flash/AS3_Drag_Targets.fla

  • Drag and drop into the structure of recursive tree using af: tree

    I use version 11.1.1.2.0 jdeveloper.

    I have a table of the following structure:

    groupVO.
    id   name    parent_id
    1   group1   -1
    2   group2   -1
    3   subgp1    1
    4   subgp2    1
    5   leaf1        3
    6   leaf2        4
    7   leaf3        3
    To implement this as a tree, I created a static vo, RootVO, with a row (root-1).
    This is defined as the parent of groupVO using a link from the view.
    Then, I created a viewlink groupVO to himself.
    Then, I created an af:tree with these your. The tree looks like this:
    Root
         ->group1
                      ->subgp1
                                   ->leaf1
                                   ->leaf3
                      ->subgp2
                                   ->leaf2
         ->group2
    Now how can I implement drag and drop in this case?
    What I have to do in drag - move, it's just update the component parent_id enjoy the ID of the node dropsite.

    Also, I need to display the details of the node selected in a form. I found that by dragging the child vo does not have the trick here. It shows only the first child node of the table.

    Published by: josetuttu on July 17, 2011 23:23

    Hello

    I have a similar case (non recursive tree) described here.

    http://www.gabrielsideras.com/2010/10/23/ADF-drag-and-drop-functionality-in-an-aftree-component/

    To implement the move I use model method instead of a method to support bean.

    Gabriel.

  • Problem slider disappears / Drag and Drop does not work

    Hey everybody,

    I have an urgent problem.

    Three butterflies are supposed to be slipped into an object.  My custom cursor is a kind of net to catch these butterflies.


    For the cursor, I have this code:

    cursor_mc.StartDrag ("true");
    Mouse.Hide ();

    My drag and drop code is:

    cursor_mc.addEventListener (MouseEvent.MOUSE_DOWN, startMove);
    redbutterfly_mc.addEventListener (MouseEvent.MOUSE_DOWN, startMove);
    violetbutterfly_mc.addEventListener (MouseEvent.MOUSE_DOWN, startMove);
    yellowbutterfly_mc.addEventListener (MouseEvent.MOUSE_DOWN, startMove);

    cursor_mc.addEventListener (MouseEvent.MOUSE_UP, stopMove);
    redbutterfly_mc.addEventListener (MouseEvent.MOUSE_UP, stopMove);
    violetbutterfly_mc.addEventListener (MouseEvent.MOUSE_UP, stopMove);
    yellowbutterfly_mc.addEventListener (MouseEvent.MOUSE_UP, stopMove);


    function startMove(evt:MouseEvent):void {}
    redbutterfly_mc.StartDrag ();
    cursor_mc.StartDrag ();
    violetbutterfly_mc.StartDrag ();
    yellowbutterfly_mc.StartDrag ();
    }

    function stopMove(evt:MouseEvent):void {}
    redbutterfly_mc.stopDrag ();
    cursor_mc.stopDrag ();
    violetbutterfly_mc.stopDrag ();
    yellowbutterfly_mc.stopDrag ();
    }

    But when I'm clicking on a butterfly my cursor stops to move and stay on the throttle position, that I'm dragging. After a fall, there is no cursor at all so we don't know where the mouse is currently located.

    Anyone know why it does not work? I am currently working with a mousefollower, because right now, it's the only way it works...

    The mousefollower code is:

    addEventListener (Event.ENTER_FRAME, enterFrameHandler)

    function enterFrameHandler(event:Event):void {}
    cursor_mc.x += cursor_mc.mouseX / 4;
    cursor_mc.y += cursor_mc.mouseY / 4;
    }

    But now I have the problem that only the Yellow Butterfly moves even if I'm clicking on red or purple...

    Please help me! Thank you in advance!

    Try to use the following code to manage the cursor_mc...

    Mouse.Hide ();
    cursor_mc.mouseEnabled = false; keep the cursor to interfere
    this.addChild (cursor_mc); to place the cursor at the highest level

    function moveCursor(evt:MouseEvent_=_null):void {}
    cursor_mc.x = mouseX;
    cursor_mc.y = mouseY;
    }
    stage.addEventListener (MouseEvent.MOUSE_MOVE, moveCursor);

    moveCursor(); to locate initially mouseover

  • Drag and drop from the tree to datagrid does not

    Hello
    I'm looking for a very simple setup drag and drop from the tree to datagrid and I see a weird behavior... when I drag a node of the tree to the datagrid... It is added to the DataGrid, but gets also reproduced in the tree of the source (except the first moved node)
    Here is the link where you can see what is happening
    Link to the sample application
    View source is enabled then please take a look and let me know what I am doing wrong

    Thank you

    "adeelmahmood" wrote in message
    News:g81gjh$FEC$1@forums. Macromedia.com...
    > Hi there
    > I'm trying a very simple setup drag and drop from the tree to datagrid
    > and I
    > see weird behavior... when I drag a node of the tree for the
    > datagrid
    > .. It is added to the DataGrid, but gets also reproduced in the source
    > tree
    > (except the first moved node)
    > Here is the link where you can see what is happening
    > http://mankatomoose.org/temp/treedragtest/TreeDragTest.html
    > View source is enabled then please take a look and let me know what I am
    > making
    > evil

    The source for an XMLListCollection is an XMLList. The XMLListCollection is
    a _view_ of the XMLList and has no existence apart from him. The XMLList
    its source is always an integral part of the original XML. Then, when you
    Add a node to the XMLList which is the source for your DataGrid, you also add
    it to 'something' in the original XML document. I think that you either need to make a
    copy of the knot or just look at filtering the XMLListCollection. Peter
    ENT it manages in this example by making a copy (ish)
    http://weblogs.Macromedia.com/pent/archives/2006/11/tree_drag_and_d_1.html.

    HTH;

    Amy

  • Closed: ADF tree with Drag and Drop

    Hi all

    How to implement drag and drop functionality in ADF tree where we manage to reorganize the tree.
    Is this possible? any material / sample for the same thing.

    Thank you.

    Chris Muir has bloged about this 't-fit-all.blogspot.com/2009/09/jdev-11gr1-aftree-mashup-using.html http://one-size-doesn
    and AMIS has this http://technology.amis.nl/blog/3302/dropping-trees

    Timo

  • Problem with Drag and Drop (Captivate 8)

    I have a drag and drop set-up of four headers that must be moved to the appropriate columns.  Objects and targets have all been defined properly.  I also have a "Submit" and "Reset" this button.  I've set up two shares advanced to be executed on the success and failure, respectively.  The approach of successful shows 4 points (a smart shape, 2 text boxes and a button 'Continue'), failure is supposed to show 4 points higher (a smart shape, 2 text boxes and a button "try" again).

    The "Success" action advanced works perfectly.  The action of the Advanced 'failure' is not.  Nothing appears when you provide inaccurate answers, he keeps just a static screen.  The reset button will attempt to reset however.  Must I specify somewhere that all the wrong answers must display text of failure.  I want the text to display if any of the four headers are placed correctly and I thought he would do this by default.

    What Miss me?

    That's what I thought, endless attempts.

    I know it's confusing, but the action of 'Failure' is actually an action "after the last attempt" that you can find for Question slides. This means that infinite attempts, it will never be executed and should be grayed out, but sorry it won't be dimmed. Unlike the legend of default that will appear after each failure. Little inconsistency...

  • Having problem adding to drag-and - drop operation to move the furniture on a floor plan

    I have the following code. I need to create floor plans where users can drag and drop the furniture on the floor plan.  I have three elements that work but when I convert all of the additional items to a symbol and select movie clip and then add several lines to the code, none work... How the code can determine that my clip I named 'couch' goes to clip 4.  Thanks if you can help, Frankie Foster

    Here is my code:

    var numObjects:uint = 3 / / assign the total number of movieclips that will be dragged

    for (var i: uint = 1; i < = numObjects; i ++) {}

    This ["movieClip_" + String (i)] .addEventListener (MouseEvent.MOUSE_DOWN, clickToDrag);
    This ["movieClip_" + String (i)] .addEventListener (MouseEvent.MOUSE_UP, releaseToDrop);

    }

    var selectedMC:MovieClip;

    movieClip_1.addEventListener (MouseEvent.MOUSE_DOWN, clickToDrag);
    movieClip_2.addEventListener (MouseEvent.MOUSE_DOWN, clickToDrag);
    movieClip_3.addEventListener (MouseEvent.MOUSE_DOWN, clickToDrag);
    movieClip_1.addEventListener (MouseEvent.MOUSE_UP, releaseToDrop);
    movieClip_2.addEventListener (MouseEvent.MOUSE_UP, releaseToDrop);
    movieClip_3.addEventListener (MouseEvent.MOUSE_UP, releaseToDrop);


    function clickToDrag(event:MouseEvent):void
    {
    selectedMC = MovieClip (event.currentTarget);
    selectedMC.startDrag ();
    }

    function releaseToDrop(event:MouseEvent):void
    {
    event.currentTarget.stopDrag ();
    }

    stage.addEventListener (KeyboardEvent.KEY_DOWN, nextQuestion);

    function nextQuestion(event:KeyboardEvent):void {}
    trace (Event.keycode);
    if(Event.keycode == Keyboard.Right)
    {
    selectedMC.rotation += 5;
    }

    if(Event.keycode == Keyboard.Left)
    {
    selectedMC.rotation-= 5;
    }
    }

    It is not a conflict, but it's a waste of code because they are both the same thing.  The first with the right loop is more effective in terms of coding and will make life easier for you because you only need to adjust the numObjects value to have it include more.

    You just need to assign instance names for the rest of your objects in the same way... movieClip_ # code as you (with loop version) should be enough.

Maybe you are looking for

  • Apple tv 4G - no charge aps and keeps resetting

    HI - I've just set up my new apple 4G on my existing apple account and I am surprised to see that there is no aps loaded on the main screen as it is with my 3G (e.g. ESPN, netflix, NHL, HBO, etc.). There is only standard he films/TV/Aps/photos/itunes

  • My office will connect to other wireless networks but not my own.

    original title: the internet disorder everything in my house is my internet running at home, but for some reason, my desktop connects to the internet outside but not my internet has the House that I don't know what to do?

  • The Xoom Wi - Fi SD card slot?

    More on the Forum XDA Xoom saomebody posted that they have heard of a Motorola Rep that the Wi - Fi only version will not a SD card capacity. Matt, if you are being followed, is that true?

  • I NEED URGENT HELP AS SOON AS POSSIBLE! With Movie Maker and Dvd Maker

    I have windows vista and used the program Windows Movie maker for about a month to download music and photos in a slide show.  Every day, I closed and was able to reopen my project without problem.  Last night, I decided to burn a dvd to see what she

  • HP pavilion dv7-4177 nr: crashed hard drive

    I have extra need to read comments on the boards.  I understand that I must make a new hard drive.  Also read you can buy casing external hard disk and plug in another computer to see if you can make files that cannot be lost. It doesn't matter if co