Wednesday 22 January 2014

Oracle ADF. Master-Details relation with “details” being displayed as inline row details

 

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

image


For employees create VO with bind variables


image


 


Our idea will be the following. We will display the details in the iframe component.


Create new bounded task flow.


image


In the property of the flow make the following changes


image


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.


image


image


Test your work by running the task flow XML


image


You will be prompted to enter the parameter. Put some value (I put 60).


Note the “pDept” appears in the URL.


image


Now create a page and drag to it the “Departments” VO from the data control


image


Add to the table “detailsStamp” facet and insert into the facet the “inlineFrame” component


image


For the frame source , put the url to details-flow XML file and use “department id” as dynamic parameter


 


image


Run the application


image


image


Download the workspace from this link


 


 



Thursday 9 January 2014

Oracle ADF – hide search icon from af:inputListOfValues or true autocomplete

 

The example bellow shows how to hide the search icon “search glass” from adf inputListOfValues component so it will look like regular auto complete field that we see all over the Web

The example was developed on 11g R2 Jdeveloper.

This is the result

clip_image002

 

clip_image002[4]

Doing this is extremely easy. Actually what you see is just a VO that I dropped on the page as a Form. “Item” has LOV defined in the “model”.

So when I dropped the VO on the page, the LOV was automatically created for me .

I used “suggestedItems” to create auto complete list as described here.

How all I have to do is to remove the “search” icon. For this I created a CSS style class and put it into application CSS file. How to create a CSS file for ADF application can be see in this grate post

Here is the Style Class

.TagSearchIconHidden af|inputListOfValues::search-icon-style

{

display: none;

}

And here is the usage of this class in “StyleClass” property for “Item” field

 

clip_image002[6]