Wednesday 27 July 2016

Programmatically execute view criteria in ADF (With two different Approaches ) part 2


Hi everyone this is the second part of  "Programmatically execute view criteria in ADF (With two different Approaches ) "

In first part i have explained in detail how you people can execute the view Criteria in AppModuleImpl class and ViewObjectImpl class
if you don't have seen yet please visit the following link

http://adfindepth.blogspot.com/2016/07/programmatically-execute-view-criteria.html

In this post i simply show the code and which method we should adopted

1) Execute View Criteria in AppModuleImpl class 



2) Execute View Criteria in ViewObjectImpl class 





The best place to execute the View Criteria 

In my point of view The view object Impl class is the best place to execute the view criteria
because in this way we can manage our application in a better way
Secondly we need less code in View object Impl class to execute View criteria



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

Tuesday 26 July 2016

Programmatically execute view criteria in ADF (With two different Approaches ) part 1

Hi everyone in this post we will see two different approaches to call the view criteria Programmatically

1) In First Method we can execute View criteria in AppModuleImpl Class
2) In Second Method we can also do the same thing in View object Impl class with less code

1) Execute Through AppModuleImpl class

Suppose you create a view criteria , 'select employees where departmetnId =:bind_parameter' on EmployeesView

To create view criteria just click on query tab of EmployeesView
1) Then click on green + icon of view criteria
2) Then click on group and select Add items
3) Then Select "DepartmentId" from Attributes
4) Then create a bind parameter by click on green + icon



Now to generate AppModuleImpl class gust select java tab of AppModule
then click on pencil icon
and select the check box just like in the following pic




Now at the end of AppModuleImpl class write the following method



Now call this method in been and pass the parameter in been
If you don't know how to call AppModuleImpl class method in been then plz visit the following link

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


2) Execute Through View Object Impl class

For this we need  to create view object impl class , for this example we are using EmployeeView
So to create java classes of  EmployeeView , click on java tab of
Then click on pencil icon
and select the check box like in picture



Now at the end of EmployeesViewImpl class write the following code



Now add this method in Client Interface of EmployeeView



Now access this method in been and execute it

Continue ...............
Link of part 2  (Describe the difference)

http://adfindepth.blogspot.com/2016/07/programmatically-execute-view-criteria_27.html






 Please Feel Free To Ask if you Face any Difficulty 
Like and share to help others
Thanks

Date 27-07-2016

Get Multiple Selected Rows In ADF

Hi everyone In this Post i will describe how to get multiple selected rows in  View Object Impl Class

you can implement this logic to multiple deletion or to update multiple rows

For this example i am using jdeveloper 11.1.2.3.0

First of all add a Transient attribute in view object with Data type Boolean and make it Update able Always


Then click on Ui Hints Tab and select Check Box from Control Type



Now create a JSF page drop a panel collection from component palette
then drop  VO on JSF page as Read only table
move the Selection Attribute at the top
and make sure the selection of Multi Rows



when your drop the VO on JSF page the Selection Attribute not appears as a check Box
so right click on inside of selection attribute and select Delete



Now from Data Control select the Selection attribute and drop it as a check box
like this


Now go to java  of view object and create java classes of view object
to create classes click on pencil i con then checked the check boxes in the following way



Now open the view object "EmployeesViewImpl" class



and the at the end of this class write the following method


To add this method to the client Interface of the view object
click on java Tab of  view object
click on pencil icon
then select and move method





Now to access this method in been follow the following steps
1) First add this method in client side bindings , for this
click on bindings of JSF page
Then from bindings click on green + icon
Then from Insert Item window select method action and click  OK








After clicking OK "create Action binding" windows appear in front  of you
Expend the "AppModuleDataControl"
Then select "EmployeesView1" and you will see the "getSelectedRow()"  method
Now just click OK
and then click on Design Tab



Now on JSF page
drag and drop a button from component palette
then create a been with request scope and create a method in been name as "button method"
then bind the button with been method ("buttonMethod")
Now in "buttonMethod " call the "getSelectedRow" Method in the following way

firstly copy the id of the method from bindings



Then write the following code in been method


Now just Run you Application select some rows hit the "getRows" button and see the result in log file




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

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

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,       ...