The first thing we need is a tree component and data structure, in this case we are going to use Oracle's hr schema tables: Departments and Employees.
In our page we drag and drop DepartmentsView from datacontrols palette and create a tree component.
The next thing we have to do is to create a View Criteria in Departments View Object (parent).
We also have to crete a View Criteria in Employees View Object (child).
We have to expose setter method of the bind variable in parent View Object.
As we exposed the bind variable in parent, we need to pass that value to the child by overriding createViewLinkAccessorRS method in parent View Object Implementation class (DepartmentsViewImpl.java)
The last step in the Model is to set a default View Criteria in parent View Object. To set it we have to right click on the View Object instance in our AppModule, click on 'Edit', select the View Criteria and click on 'Ok' button.
The Model is now finished, we now have to drag and drop the setter method from the data controls palette and create an 'ADF Parameter Form' so we can provide the filter value.
This will create 'setsearchValue' method binding in the pageDef. We also need to create a Execute operation of the parent View Object and call both operations from the 'Filter' button ActionListener.
This is how we should have the page.
Hi Ruben, Thank you for your post. I also tried to achieve similar things but in a different approach
ReplyDeletehttp://sanjeev-technology.blogspot.in/2014/07/adf-tree-searching-child-nodes-using.html
Idea was to retain search panel so that we can still use save/basic/advance/reset etc feature of search panel. Yes, I was not aware of createViewLinkAccessorRS that time.
Link not accessible
DeleteHello, I want to know if it is possible to use this approche in tree table based on just one viewObject (and view link "parentId" ==> "childId") ?
ReplyDeleteHello, I haven't tried but it should be possible to to it on a recursive View Object.
Deleteregards,
Ruben.
Does it work with you Naser i try recursive tree but it doesn't work with me
DeleteNeither I.
Delete