X
  • ADF
    February 2, 2012

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).

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.