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.
Comments
(9)
Excellent Article
written by Mit , October 09, 2007
written by Mit , October 09, 2007
Really a good one article.
Well organized structure
Excellent
Thnaks man
Votes: +0
Well organized structure
Excellent
Thnaks man
report abuse
vote down
vote up
parameter passing in call of AM method from the CO
written by Paramita Sanyal , February 19, 2008
written by Paramita Sanyal , February 19, 2008
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,
Paramita
Votes: +0
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,
Paramita
report abuse
vote down
vote up
parameter passing in call of AM method from the CO
written by Paramita Sanyal , February 20, 2008
written by Paramita Sanyal , February 20, 2008
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,
Paramita
Votes: +0
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,
Paramita
report abuse
vote down
vote up
Hi Anil!!
written by Paramita Sanyal , February 20, 2008
written by Paramita Sanyal , February 20, 2008
It was very helpful. Thank you very much..
regards,
Paramita
Votes: +0
regards,
Paramita
report abuse
vote down
vote up
Table Based Screen based on Multiple Table.
written by Mahesh , July 08, 2008
written by Mahesh , July 08, 2008
Hi Anil,
Excellent 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
Votes: +0
Excellent 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
report abuse
vote down
vote up
Advanced Table - hiding columns
written by Vis , September 29, 2008
written by Vis , September 29, 2008
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
Vis
Votes: +0
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
Vis
report abuse
vote down
vote up
...
written by Anil- , September 29, 2008
written by Anil- , September 29, 2008
Please raise on forum http://apps2fusion.com/forums
Thanks,
Anil Passi
Votes: -1
Thanks,
Anil Passi
report abuse
vote down
vote up
| < Prev | Next > |
|---|





;
good sites