Sunday, November 3, 2013

ADF Tree based on self join case, 3 functionality.(drag & drop, delete & move children, delete & delete multiple level children)

In this post I tried to show 3 operation for ADF tree using simple solution.   the drag and drop , delete node and move it's children to up level and delete node and delete multiple level children. 
the drag and drop
As shown in the images below, Having a two level tree. Expanding a node will make all detail nodes appear. drag  node from one level and drop him to another.


In the Model project we just need the  view objects  should be updatable connected with a viewLink based on common attribute ParentId. In the view object we need a bind variable which we also add to the query so that we can execute-with-params.



About delete and node and move it's children node to level up 
through application module method I get select node and update its children parent value by the value of selected root node parent value then delete value
About  delete node and delete multiple level children
  I used the power of sql to get all children for selected root node though customize the query of another updatable view object get multi level children, In the view object we need a bind variable which we also add to the query so that we can execute-with-params
And through application module method I get selected node and delete its multi level children then delete root node


The JDeveloper 11.1.1.7.0 workspace of the sample application and script file for this post can be downloaded from here