Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

OA Framework - All Articles
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

This article explains the programmatic steps required to complete a simple OA Framework Screen that interacts with the database table via screen. Prior to reading this article, you must read OA Framework Simple Screen where the underlying design of this screen has been explained. This particular screen interacts with Database via Java Entity Objects. Lets see the programmatic steps that are involved to implement the interaction between OA Framework Page and Database.

First step
As soon as the page loads, OA Framework will execute the processRequest Method against the controller of that page.
Here in this method, we wish to initialize the view object.
This step is just a copy paste from the "OA Framework Manual".
However, please note, this step is divided into two steps, because Controller must not directly interact with ViewObject.
a. From Controller [method processRequest], lets invoke a method that resides within ApplicationModule.
import oracle.apps.fnd.framework.OAApplicationModule;
.
public class demoSimpleTableCO extends OAControllerImpl
.
public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)

{
super.processRequest(oapagecontext, oawebbean);
//get the handle to AM Attached to our Simple Page Region MainRegionRN
//The page is passed as parameter to this method, hence we can get handle
//to the AM quite easily
OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
am.invokeMethod("initializeSimpleVO4PageLoad");
}


b. Now, inside the AM Implementation, we need to handle the mehod call made from "Step a" above.
import oracle.jbo.Row;
import oracle.apps.fnd.framework.OAViewObject;
.
public class Demosimple01AMImpl extends OAApplicationModuleImpl
.
public void initializeSimpleVO4PageLoad()
{
//get a handle to the View Object that we wish to initialize
OAViewObject vo = (OAViewObject)getXxOafDemoSimple01View1();
if (!vo.isPreparedForExecution())
{
vo.executeQuery();
}
//Create a blank Row
Row row = vo.createRow();
//Attach that blank row to the VO. Data will be fed into this row, when the user types into the fields
vo.insertRow(row);
//Set the status of the blank row to initialized. This tells OA Framework that record is blank and must not be included in DML
//Operations until changes are made to its underlying VO [via screen fields]

row.setNewRowState(Row.STATUS_INITIALIZED);
}




Second step
As soon as the button is clicked, OA Framework will execute a method named processRequest in the controller[ remember Controller is attached to page region.]
We need to perform a Commit from the controller when the button is clicked. But we are not supposed to call commit directly from the controller.
Hence we will invoke a method in AM, and within that method in AM "the COMMIT will actually take place".

a. From the processFormRequest in Controller, call a method that we will define in AM.
public class Demosimple01AMImpl extends OAApplicationModuleImpl
.
.

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean) ;
am.invokeMethod("saveDataToSimpleTable") ;
}

b. Now, inside the AM Implementation, we need to handle the call made from "Step a" above.
public class Demosimple01AMImpl extends OAApplicationModuleImpl
.
.
public void saveDataToSimpleTable()
{
getDBTransaction().commit();
}



Now, after having completed all the steps, lets do the testing.
a. Rebuild the project.
b. Run the page


c. Enter some data into the screen.



d. Test to confirm that data is being inserted & updated in the table.

Anil Passi

Comments   

0 #1 ajay 2007-03-16 00:00
hai
good sites
Quote
0 #2 Mit 2007-10-09 12:45
Really a good one article.
Well organized structure
Excel lent
Thnaks man
Quote
0 #3 Paramita Sanyal 2008-02-19 11:41
Hi Anil!

I could successfully try your example of calling the method defined in the Application Module from the Controller. Thank you very much such wonderful article.

But could not pass any parameter to the method! Could you please tell me how can I pass a parameter from the controller to the method of the Application Module?

Kind Regards,
Parami ta
Quote
0 #4 Paramita Sanyal 2008-02-20 03:00
Hi Anil!

I could successfully try your example of calling the method defined in the Application Module from the Controller. Thank you very much such wonderful article.

But could not pass any parameter to the method! Could you please tell me how can I pass a parameter from the controller to the method of the Application Module?

Kind Regards,
Parami ta
Quote
0 #5 Anil Passi 2008-02-20 06:29
Hi Paramita

From controller, you will use invokeMethod, as shown below
oaapplica tionmodule.invo keMethod("handl eRemoveProcurem entMapping"
, new String[] {paramStri ng01, paramString02&# 125;);


Within AM, you will do, as per your business logic....
public void handleRemovePro curementMapping (String firstParam,Stri ng secondParam )
{
//do processing here
OADBTransaction oadbtransaction = getOADBTransact ion();
oadbtransaction .commit();
}
}


Thanks ,
Anil Passi
Quote
0 #6 Paramita Sanyal 2008-02-20 07:54
It was very helpful. Thank you very much..

regards ,
Paramita
Quote
0 #7 Mahesh 2008-07-08 09:27
Hi Anil,

Excellen t site, I have a query. I have Advanced Table based screen and the underlying data for the Advanced table comes from multiple Tables or EO's. Can you please guide me on how i can handle inserts and updates for advanced tables which are based on more than one EOs. One way I can handle inserts/updates in multiple tables is using OAPlsqlEntity Objects. But is there a way I can do this using simple EO/VO.

Thanks,
Mahesh
Quote
0 #8 Vis 2008-09-29 08:54
Hi Anil,

Based on certain condition I do not want to display one of the column from my advanced table. Please could you let me know how to do that.

Thanks
V is
Quote
0 #9 Anil- 2008-09-29 09:02
Please raise on forum http://apps2fusion.com/forums

Thanks,
Anil Passi
Quote
0 #10 Pradeep Dahake 2011-12-13 16:05
Dear Anil

need your help.

consider the same page which is displayed in this article (OA Framework Controller ViewObject for Table Based Screen)

my requirement is

if user select one (i have singleselect) row from the list of rows displayed and click on the button "Save data to table", i want to fetch person_id from VO and do certain validation.
wha t i am trying is, extending the controller and in the processFormRequ est trying to get the handle for the button, and if handle tells me that button is clicked, calling a method in AM to find which row in VO is selected.
i am facing following problems which i am seeking help from you :)

1. button on the page is not submit button, its simple button, i checked for event but it is null. how to get handle for this button. button is on OATableBean
2. in AM, how to find out the currently selected row, i tried with getCurrentRow but it is throwing Null pointer error.

Please can you help me on this.
Quote
+1 #11 abhik 2012-07-27 07:45
hi anil,
i am passing some values from one page to another. In processRequest of the next page I can see the values.
Now I want to display them in a table once the page loads.. Can you please tell me how do i do that??

Thanks in advance,
Regards,
Abhik.
[]
Quote
0 #12 khushi 2012-08-17 02:28
Hi i want to display all the data of some column from database table once i run page...
can u help me to do this?
Quote

Add comment


Security code
Refresh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Apr 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
  1  2  3  4  5  6  7
  8  91011121314
15161718192021
22232425262728
2930     

Enquire For Training

Related Items

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner