Drag ADF table record & drop on bar graph in Jdeveloper 11.1.2.0.0

In Jdeveloper 11.1.2.0.0,we can drag any component & drop on graph.It also supports drag/drop between graphs.

Use Case Description

Let us consider a use case wherein we will drag table row & drop that on the bar graph.

Implementation steps

Assume that we have table with Emp records & bar graph that displays Empno & Salary of Employees.

Insert drag component inside table:  <af:dragSource discriminant="tab"/>


Now insert dropTarget inside barGraph:

<af:dropTarget dropListener="#{test.handleTableDrop}">
      <af:dataFlavor
       flavorClass="org.apache.myfaces.trinidad.model.RowKeySet"    discriminant="tab"/>
</af:dropTarget>


public DnDAction handleTableDrop(DropEvent dropEvent)

{
        // Add event code here...
        System.out.println("Dropped id is"+dropEvent.getDragClientId());
        return DnDAction.NONE;
 }

Run the above page .Drag any table row & drop that on the bar Graph.
Note that handleTableDrop method gets executed & it prints dragged client id(i.e table id).

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips and Tricks from Oracle's JDeveloper & ADF QA

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today