X

Shay Shmeltzer's Oracle Development Tools Tips

Simple Hierarchy Viewer Search with ADF BC

Shay Shmeltzer
Director of Product Management - Oracle

This is actually based on a severe case of RTFM - by me. I got a request to help someone with implementing a search functionality inside the Hierarchy Viewer component. For some reason I assumed that this will need to be done in a programmatic way using the new dvt:search and dvt:searchresults dub-tags of the dvt:hv. Well after playing around for some hours I got to a point where I actually opened the documentation, and then I had my RTFM moment when I found <a href="http://download.oracle.com/docs/cd/E16162_01/web.1112/e16182/graphs_charts.htm#ADFFD22229">this</a>.

Turns out that when you are using ADF BC as the base for your Hierarchy Viewer there is a simple way to hook up the search functionality in a declarative way.

Basically you set your HV to be based on a ViewObject that has a parameter. Then you add another VO that gives you the list of values and allows you to search by any attribute your want (name in the sample below). Then the second Vo basically populates the parameter of the first VO - all without coding.

Something like this:

P.S. - if you need a basic introduction to working with the hierarchy viewer see this past entry.

Join the discussion

Comments ( 6 )
  • guest Friday, June 28, 2013

    Hi Shay,

    Please share the sample workspace of the tutorial.


  • darragh duffy Saturday, September 21, 2013

    Hi Shay any chnace you can make the following URL avaialble again ?

    https://blogs.oracle.com/shay/2009/07/exploring_the_hierarchy_viewer.html


  • shay Saturday, September 21, 2013

    Darragh - the right link is https://blogs.oracle.com/shay/entry/exploring_the_hierarchy_viewer I'll fix the link in this blog


  • darragh Thursday, October 10, 2013

    Hi Shay, I followed your example for adding databound search to the HV but this does not appear to work for the HTML5 rendered solution. So you have a nice programmatic way to implement this search or can you show how to get searching working for the HTML5 version in a declarative approach?


  • Ashok Monday, December 21, 2015

    Hi Shay,

    I'm seeking a help to implement below requirement - appreciate your time and efforts for proving help.

    I'm trying you implement my company organization chart using <dvt:hierarchyViewer>.

    My requirement is I need to show the hierarchy of currently logged in user/employee. But By default ADF is displaying complete org chart or if I apply View Criteria as supervisor id to null its started displaying from CEO/President to current logged-in user based on number of Descendant Levels.

    My requirement is if user logged in is "Manager",I need to display his subordinates/immediate child nodes on launch of application. From there child node of Manager can be expanded further if it has child nodes.

    Also when I click on navigate up on Manager node his supervisor (say Sr.Manager) node with child nodes as Manager node and his peers under Sr.Manager node should display this navigation can go up till top level.

    My application should show customized nodes only not complete organization.

    Could you anyone has implemented the same using ADF Hierarchy Viewer component,Please guide me how and where to start this application.

    I've a only one Employee table this will have employeeId and supervisorId as columns. CEO will have supervisorId as null.


  • guest Tuesday, January 5, 2016

    Ashok, you need to modify the VO query that populates the HV to restrict the fetching just for the records you want it to show, you can have that query be based on a parameter that you pass in with the specific logged in user.

    A bit more here - https://blogs.oracle.com/shay/entry/simple_hierarchy_viewer_search_with


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