This Oracle ADF training tutorial shows how Oracle ADF Faces provides a wonderful tree component that allows you to view parent/child data. For example, suppose you have the following tables: REGIONS, COUNTRIES, LOCATIONS, DEPARTMENTS, and EMPLOYEES. There are foreign key relationships between the tables, so if you create ADF view objects, you’ll also have view links created that represent those relationships.
To create a tree on your .jsf page, all you really need in your data control is the root level – REGIONS. However, if you want to maintain the currency whenever a user clicks on any level in the tree, you need to have the other children levels present in your data control. To accomplish this, we edit the application module’s data model and shuttle over the view objects.
The resulting Data Control Palette looks like this:
After dragging the Regions view instance onto the page and selecting the Tree component option, you are then presented with the tree binding editor:
You then shuttle over the attributes you want visible in the tree for each level of the hierarchy. By default, the top level (Regions) is automatically synchronized with the tree model’s currency. For the other levels, however, you must create an iterator binding, then assign the target data source to that binding. You can create the iterator binding by going to the JSF page’s binding tab, then selecting the green plus icon in the middle panel to create the binding.
You can see the whole video describing the whole process from start to finish here:
Take a look at our full playlist of introduction ADF training tutorials herePlease Share This Knowledge With Others!