Sunday 26 June 2016

How To Call AppModuleImpl Class Method In Been Through Binding (Second Method)

Hi Every one in this post we will see how to call custom method from AppModuleImpl class pragmatically

In my previous post i have call AppModuleImpl class method in an other way , if you don't have seen yet please visit the following link

http://adfindepth.blogspot.com/2016/06/how-to-call-appmoduleimpl-class-method.html

For this post
Firstly i create a SQL Query base view object  name as EmpVo that takes two parameter

select * from employees e where e.department_id=:bind_deptID and e.first_name like :bind_fName||'%'

we pass the value dept_id and :fName in been and will execute query in AppModuleImpl class

Now create a jsf page drag and drop  EmpVo on page from Data Control  and also drop a button on page
Then create a been with request scope and a button method
 your page will be look like this



Now go to AppModuleImpl class create following method to bind the variable values with query
This method takes two parameter dept_id and fName , attach these values with query and then execute the Query



 Add this method to client Interface of AppModule ,
click on right side pen icon (Edit application module client Interface)
Select exeEmpQ Method from Available side and move to selected side , then click Ok







Now add this method in bindings
Open your JSF page and click on Bindings


Click on + icon of Bindings
Select methodAction from Insert Item and click OK



Now in Create Action Window
Select AppModuleDataControl
In Operation you will see exeEmpQ Method , just click OK



Now From Bindings select exeEmpQ method
Copy the Id of this method
After copy click on Design


Now in been write the following code





Now Run your JSF page and click on button Execute Query






Please Feel Free To Ask if you Face any Difficulty 
Like and share to help others
Thanks
Date 27-06-2016


Friday 24 June 2016

How To Call AppModuleImpl Class Method In Been Through Binding (First Method)

Hi Every one some time we need to call AppModuleImpl class Method
So , in this post we will see
How we can call a method from AppModuleImpl class
How we can pass parameter to the method


Firstly we need to create method in AppModuleImpl class , for this we need to generate AppModuleImpl class
Simply double click on AppModule , click on java tab , then click on Edit java option
 Checked the check box for AppModuleImpl



Then click on the link to go inside class



At the end of class create your custom method
I have created a method getData , that takes two parameter  a and b , now in method i just print the value of a and b



Then to add this method in client Interface
go to AppModule
click on pen icon
and move getData method from left to right and click ok


Now create a jsf page that contains two input text fields , Then create a been name as ButtonHandler with request scope and create value binding for input text fields to get the value of input text fields in been

To create value binding for input text field ,select the input text field , click on property menu and
select Expression Builder


From the Expression Builder , Expand the ADF Managed Beens
here you will see created been (ButtonHandler)
select ButtonHandler been and click on create property
then write the name of property for example x and select int as data type
after that just click on ok ,ok


Repeat the above step to create value binding for second input text field ...

In Data control you can see the getData method
just drag and drop  getData method on jsf page as a button  , and you will see Edit Action Binding window
Form the Edit Action Binding window you can set the values for method parameter (remember a and b)




To set the value for a parameter just double click on value and select Show EI Expression Builder




Then from Variable select x and click ok ok


 Now again double click on value to set the value of second parameter (b) and select Show EI Expression Builder
Then from Variable select y  and click ok , ok



Finally Right click on jsf page and select Run
now enter value 10 in first field and 20 for second field and click on getData button ,
and look carefully on log screen






Please Feel Free To Ask if you Face any Difficulty 
Like and share to help others
Thanks
Date 24-06-2016

Monday 20 June 2016

How to get an attribute Value in been by using AttriubteValues and Set Property Listener component

Hi Every one in this post i will describe how to get attribute's value in been

For this post i will get DepartmentId Form Departments Table and show on log screen

So Let's start

I have a read only  Department table and a button on jsf page

Firstly to create been with request scope just select button and create an Action Binding

Click on property Menu and click on Edit



To create new been click on New , write the name of been and class and select request scope
and click Ok


To create new method click on New , write the name of Method and click on OK


Click on Bindings of jsf page then click on + icon of Bindings and select AttributeValues and click OK





Then select DepartmentsView1 as Data Source and DepartmentID as attribute



Now Click on Design
 Select Button and drag and drop set property Listener form Component pallet on Button



To get value form DepartmentId attribute click on property Menu and select Expression Builder




Expand ADF Bindings , then Expand Bindings , then DepartmentId and select inputValue and click on OK



To send value of DepartmentId to been , Click on property Menu and select Expression Builder
then Expand ADF  Managed Beens and select ButtonHandler been and click on Create Property




Write property name and select int data type and click OK



Select type as action



Now go to ButtonHandler been and in get_value method just DepartmentId print on log screen


Now Run your jsf page select any Row and click on button
On log screen you will see the current's rows DepartmentId





Please Feel Free To Ask if you Face any Difficulty 
Like and share to help others
Thanks
Date 20-06-2016

Tuesday 14 June 2016

Primary Key Auto Insert In ADF (Equivalent to before commit trigger in forms)

Hi Everyone in this post i will describe how to auto insert Primary key in ADF , The key will be save before commit , means when ever a user enter a new record and hit save , the primary key will automatically append with the new record and save in database

For this post i use Departments table
So to insert Primary key automatically just Run your jdeveloper and create a new Application and
create Departments Entity object and View object , if you don't know how to create new Application please click on following link

http://adfindepth.blogspot.com/2016/05/how-to-start-with-adf.html

After creating Application the first step is generate DepartmentsImpl class
just double click on Departments Entity object , then click on java Tap , and then click on Edit java option



Now check the box "Generate Entity Object Class" and also make sure that check boxes are checked for
Accessors
Data Manipulation Method
Create Method
Remove Method
After checked all the five check boxes click on OK


Now click on the link to open the DepartmentsImpl class


Now at the end of DepartmentsImpl class create a method to generate Max Id



After creating maxId method , modify the doDML method , in the following way
(Note  :-    ADF Framework automatically created doDML method when you generate DepartmentsImpl class , you just need to modify it according to your requirement)


After modifying doDML method just click on save



Now double click on Departments Entity Object and click on attributes ,
Then select DepartmentId and unchecked Mandatory




Again click on save all , and Right click on AppModule and select Run

Now double click on DepartmentsView1 and click on + sign
After clicking on + sign , you can enter new record ,
Fill DepartmentName
ManagerId
and LocationId
but do not enter any value for DepartmentId (it will automatically save)
After insert three values then click on "save change to database" (commit)



After clicking on "save change to database"(commit)
you will see this view





Please Feel Free To Ask if you Face any Difficulty 
Like and share to help others
Thanks
Date 15-06-2016


Saturday 11 June 2016

How to Create View Link in ADF

Hi Everyone in this post i simply show you how to create ViewLink between two View Objects in ADF
For this post i have created two SQL Query base view objects  , name as
EmpQB and
DeptQB
if you don't know how to create Query base view object please visit the following Link

http://adfindepth.blogspot.com/2016/06/sql-query-base-view-object-manually.html 

To create View Link
Just Right Click on Model and select New


Then from the "New Gallery" select ADF Business Components form categories and View Link from Items and then click OK


In next window select View Link Name and Display Name and click on Ok


In next window select DepartmentId from DeptQB in "Select Source Attribute" side (Master table)
Then from EmpQB also select DepartmentId in " Select Destination Attribute" side   (Detail table)
click on "Add"
and Then click on Next



Next window show the properties of View Link    , for now we go with the default properties , Just click on Next


Again Just click on Next


Again Next




In next window you can add an instance of this view link to an AppModule
For this checked the "Add to Application Module " check box
Then click on Browse and select AppModule and click on OK
Now Click on Next


The next window just show the summary about this View Link
click on Finish


Now to check view Link properly created or not
Right Click on AppModule and select Run


From the New Window double click on DeptNdEmpVL and check data , it will be look like the following pic





Now move to next Department by click on arrow sign and you will see the employees data will also change
according to Department





Please Feel Free To Ask if you Face any Difficulty 
Like and share to help others
Thanks
Date 10-06-2016

Query to get Business unit (ORGANIZATION_ID) Detail in oracle Fusion

  SELECT HAO.ORGANIZATION_ID AS BUSINESS_UNIT_ID,         HAOT.NAME,         HAO.BUSINESS_GROUP_ID,         HAO.EFFECTIVE_START_DATE,       ...