Recent Bloggers
Tanweer Ahmed Ansari Posts: 2
Stars: 2
Date: 7/23/10
Savio Edward Coelho Posts: 1
Stars: 0
Date: 7/9/10
Muhammed Shakir Misarwala Posts: 8
Stars: 0
Date: 6/30/10
vc vijayan Posts: 5
Stars: 0
Date: 6/24/10
  Blogs Aggregator
Drag & Drop Operation in Flex

 Following is the excerpts from Adobe Flex Docs

The drag-and-drop operation

The following steps define the drag-and-drop operation.

  1. A component becomes a drag-and-drop initiator in either of the following ways:
    • List-based components with dragEnabled=true

      Flex automatically makes the component an initiator when the user clicks and moves the mouse on the component.

    • Nonlist-based components, or list-based components with dragEnabled=false

      The component must detect the user's attempt to start a drag operation and explicitly become an initiator. Typically, you use the mouseMove or mouseDown event to start the drag-and-drop operation.

      The component then creates an instance of the mx.core.DragSource class that contains the data to be dragged, and specifies the format for the data.

      The component then calls the mx.managers.DragManager.doDrag() method, to initiate the drag-and-drop operation.

  2. While the mouse button is still pressed, the user moves the mouse around the application. Flex displays the drag proxy image in your application. TheDragManager.defaultDragImageSkin property defines the default drag proxy image.

    You can define your own drag proxy image. For more information, see Example: Specifying the drag proxy.

     

    Note: Releasing the mouse button when the drag proxy is not over a target ends the drag-and-drop operation. Flex generates a DragComplete event on the drag initiator, and the DragManager.getFeedback() method returns DragManager.NONE.

     

  3. If the user moves the drag proxy over a Flex component, Flex dispatches a dragEnter event for the component.
    • List-based components with dropEnabled=true

      Flex checks to see if the component can be a drop target.

    • Nonlist-based components, or list-based components with dropEnabled=false

      The component must define an event handler for the dragEnter event to be a drop target.

    The dragEnter event handler can examine the DragSource object to determine whether the data being dragged is in an accepted format. To accept the drop, the event handler calls the DragManager.acceptDragDrop() method. You must call the DragManager.acceptDragDrop() method for the drop target to receive the dragOver,dragExit, and dragDrop events.

    • If the drop target does not accept the drop, the drop target component's parent chain is examined to determine if any component in the chain accepts the drop data.
    • If the drop target or a parent component accepts the drop, Flex dispatches the dragOver event as the user moves the proxy over the target.
  4. (Optional) The drop target can handle the dragOver event. For example, the drop target can use this event handler to set the focus on itself.
  5. (Optional) If the user decides not to drop the data onto the drop target and moves the drag proxy outside of the drop target without releasing the mouse button, Flex dispatches a dragExit event for the drop target. The drop target can optionally handle this event; for example, to undo any actions made in the dragOver event handler.
  6. If the user releases the mouse while over the drop target, Flex dispatches a dragDrop event on the drop target.
    • List-based components with dropEnabled=true

      Flex automatically adds the drag data to the drop target. If this is a copy operation, you have to implement the event handler for the dragDrop event for a list-based control. For more information, see Example: Copying data from one List control to another List control.

    • Nonlist-based components, or list-based components with dropEnabled=false

      The drop target must define an event listener for the dragDrop event handler to add the drag data to the drop target.

  7. (Optional) When the drop operation completes, Flex dispatches a dragComplete event. The drag initiator can handle this event; for example, to delete the drag data from the drag initiator in the case of a move.
    • List-based components with dragEnabled=true

      If this is a move operation, Flex automatically removes the drag data from the drag initiator.

    • Nonlist-based components, or list-based components with dragEnabled=false

      The drag initiator completes any final processing required. If this was a move operation, the event handler must remove the drag data from the drag initiator. For an example of writing the event handler for the dragComplete event, see Example: Moving and copying data for a nonlist-based control.


  • Comments
Trackback URL:

  Blogs
Finder Methods in Liferay
  I have come across many newbies who find it difficuilt understanding & implementing the finder methods in Liferay.This blog will come as a rescue to those beginners.Here I will first explain the scenario where finder methods are used and then discuss its implementation. Let take a scenario where we are making a database of the employees in some organization.Assume some of the fields...
Read More »
Implementing XMLBeans
  XMLBeans is a fantastic technology provided by Apache which is used for marshalling and un-marshalling XML.This helps us to bind XML into Java Types.In this blog, I will first introduce the scenario where XMLBeans comes handy.While progressing I will mention about the configuration required , generating the Java classes and using them. Lets take the scenario where the user requests...
Read More »
How to change the portlet title at runtime
Simply use the following line in your jsp page to set portlet name. renderResponse.setTitle("vijayan");
Read More »
Developing themes
1. Developing Themes For Liferay 2. Download liferay-plugins-sdk-5.2.3 and unzip it. 3. Create Java Project in your eclipse      1.New->Java Project      2.Project Name :-any name that you want      3.Select Create Project from existing source and select your liferay-plugins-sdk-5.2.3 folder      4.finish. 3....
Read More »
Showing 1 - 5 of 24 results.
Items per Page
Page of 5