This post was developed with Jdeveloper 11g R2 (11.1.2.3)
ADF supports out of the box master details relation. You can define the View Link and drop the child VO from the “Data Control” section and ADF will ask you what kind of “Master-Details” do you want to create. If you choose “Master table – Details table”, the ADF will generate for you 2 table one above other.
However it may be much nicer to display the detail table inline with master row.
Note!!!! Don’t confuse it with a “tree” component
I will use the HR sample schema from Oracle to present the employees of specific department.
First of all we will create the model. Do not create the View Link between “Departments” and “Employees”.
For department just create VO based on SQL
select * from departments
select * from departments
For employees create VO with bind variables
Our idea will be the following. We will display the details in the iframe component.
Create new bounded task flow.
In the property of the flow make the following changes
It means that you can directly access this task flow from URL and it accepts the “pDept” parameter
Drag “exceute with params” from Data Control for Employees VO and use pageFlowScope.dept value (that we used to store the URL parameters) as input parameter
Create new page view to display the “Employees” table.
Test your work by running the task flow XML
You will be prompted to enter the parameter. Put some value (I put 60).
Note the “pDept” appears in the URL.
Now create a page and drag to it the “Departments” VO from the data control
Add to the table “detailsStamp” facet and insert into the facet the “inlineFrame” component
For the frame source , put the url to details-flow XML file and use “department id” as dynamic parameter
Run the application
Download the workspace from this link