Simple Hierarchy Viewer Search with ADF BC

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.

Comments:

Hi Shay,

Please share the sample workspace of the tutorial.

Posted by guest on June 27, 2013 at 10:04 PM PDT #

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

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

Posted by darragh duffy on September 21, 2013 at 04:21 AM PDT #

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

Posted by shay on September 21, 2013 at 12:08 PM PDT #

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?

Posted by darragh on October 10, 2013 at 07:35 AM PDT #

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.

Posted by Ashok on December 21, 2015 at 09:28 AM PST #

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

Posted by guest on January 04, 2016 at 04:36 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

me
I'm a Director of Product Management for the Oracle Mobile and Development Tools.
Follow me:
Search

Archives
« May 2016
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
31
    
       
Today