Drag and Drop is one of the core feature of Oracle ADF. In this post we will see how simple is to achieve this functionality.
Example Use Case:
We need to select few employee to visit Oracle Open world 2010, but management will choose only their favorite employees :) so they will drag employees images from left pane (Drag from) to the Selected employees List box. Employee Id can also be seen under the Image.
I will just shortly summarized the technical expect in the example. Rest you can explore by downloading the workspace.
Components and Methods used in this example:
- af:attributeDragSource : Under Image component allows to drag the image to dropTraget area.
- af:clientAttribute : Under Image component sets as employee full name as its value.
- af:dropTarget: Sets the drop target area on the List box and allows to call Drag and Drop handler method.
- af:attributeDropTarget: set its value as source's value if dropped on it.
- DnDHandler class has a
- Private variable called choices of type List
which binded into the List Box
- Drop event handler method called handleItemDrop which returns DnDAction type adds an element in the list box component.
feel free to comment