Technical Articles
Oracle Application Framework
OA Framework Extending Controller - Steps 

| OA Framework Extending Controller - Steps | | Print | |
| Written by Anil Passi | |
| Wednesday, 10 January 2007 | |
|
The objective of this training lesson is to quickly show you how to Extend a Controller in OA Framework.
The basis of this article will be the HelloWorld OA Framework Example. This demonstration has been built using 11.5.10 CU2. But this should work with any other version of OA Framework. How will we demonstrate this? a. We will create a Text Field named HelloWorldField in "OA Framework Page" b. Using processRequest of the Controller, we will default "Hello not Extended Anil" to HelloWorldField c. Next we will extend the controller, and assign "Hello Extended Anil" to the field HelloWorldField Note: You must noe default values in field in this manner, when the field belongs to a VO Assumptions:- You have already implemented the Oracle delivered HelloWorld Example. Follow the below Steps ( Some steps are a repeat of helloWorld tutorial from Oracle). But this demo will use a cut-down version of helloWorld. Estimated time:- 15minutes for this exercise. Step 1. Create a New OA Workspace and a new OA Project and name it anything you desire. Package name can be oracle.apps.ak.hello Also, attach dbc file, and a apps username/password that has responsibility FWK_TBX_TUTORIAL Step 2. Add a new "OA Page" named "textExtendCOPage" to the Project in package oracle.apps.ak.hello.webui Make sure its property AM Definition is oracle.apps.fnd.framework.server.OAApplicationModule Change its id to textExtendCOPage and ensure its of type pageLayout Also assign it any window tile and title in its properties Step 3. Add a region of type messageComponentLayout. Name it MainRNExt The Region Style will be messageComponentLayout Step 4. Add a field HelloNameField to MainRNExt The field will be of type messageTextInput. Give it a prompt of "TestPrompt" Note:- We do not need a Go/Submit button for this demo. Step 5. Rightclick on MainRNExt to add a new Controller to the region. Make sure its package is oracle.apps.ak.hello.webui Name of the controller will be MyTestCO Step 5. Open the controller java file, which is MyTestCO.java Make the following changes as highlighted import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean; public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAMessageTextInputBean fieldHelloName = (OAMessageTextInputBean)webBean.findChildRecursive("HelloNameField"); fieldHelloName.setText(pageContext,"Hello not Extended Anil"); } Build and Run the XML Page, the result will be as below Now, the extension of OA Framework Controller Extension Step 1. Rightclick on Project and create new Name of the Class: extendedHelloCO Package : oracle.apps.ak.extendCO Extends: oracle.apps.ak.hello.webui.MyTestCO Extension Step 2. Add the highlighted lines to extendedHelloCO.java package oracle.apps.ak.extendCO; import oracle.apps.ak.hello.webui.MyTestCO; import oracle.apps.fnd.common.VersionInfo; import oracle.apps.fnd.framework.webui.OAControllerImpl; import oracle.apps.fnd.framework.webui.OAPageContext; import oracle.apps.fnd.framework.webui.beans.OAWebBean; import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean; import oracle.apps.fnd.framework.webui.beans.OAImageBean ; public class extendedHelloCO extends MyTestCO { public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAMessageTextInputBean fieldHelloName = (OAMessageTextInputBean)webBean.findChildRecursive("HelloNameField"); fieldHelloName.setText(pageContext,"Hello Extended Anil"); } } Extension Step 3. Ensure that personalization is turned on for your username. This can be done by setting profile "Personalize Self-Service Defn" to Yes Run the XML page, you will still see "Hello Not Extended Anil" Click on Personalize Page link on right handside top corner. Select "Complete View" and "Expand All" Option in personalization page. Click personalize icon for "Message Component Layout: (MainRNExt)" Set the controller to " Click on Apply, and then click onReturn to Application. Extension Step 4. Rebuild project in jDev and run page again. You will now find that your extension has taken effect. This completes the exercise for the extension of a Controller in OA Framework [OAF]. Comments
(20)
written by Anil Passi , February 19, 2007 written by Sai , February 19, 2007
Hi Anil,
Error when updating the saved Expense Report On Oracle Internet Expense (OIE) when user tries to update the saved expense report system gives following error message: Unable to perform transaction on the record. nCause: The record has been deleted by another user. nAction: Cancel the transaction and re-query the records to get the new data. Steps to reproduce this issue: 1) From Expense Home Page Update a saved expense report 2) For any expense report line ֖ go to the details page, update any field (say Justification), Click Return button, Click Save button on the Expense page 3) Again go to the details page, update any field (say Justification), Click Return button, Click Save button on the Expense page 4) This time the system gives the above error message Note: 1) We have some OAF customizations and the issue is NOT happening on vanilla (non-customized) instance. 2) It is only when the user try to save the update done for the second time on the Expense Detail Page. 3) We have found a metalink note: 352698.1 with same error but unable to interpret it. Any pointers to resolve this issue are highly appreciated. Thanks and Regards, Sai written by Sai , February 28, 2007
Hi Anil,
Thanks for your response. I have further debugged this issue and got to know where exactly the code is failing. In iExpenses when the user try to save the update done for the second time on the Expense Detail Page then in the code following happens: 1) When Click on SAVE button then ButtonsCO in ProcessFormRequest is called > 2) Then RootApplicationModule: WebExpensesAM invokes Method: SaveExpenseReportFromWeb 3) Which in turn invokes the Method: SaveExpenseReport 4) In Method: SaveExpenseReport the code - OADBTransactionImpl.commit fails Note: a) This issue happens only when user try to save second time. The first time it works fine. b) Also this happens only when we go to expense line detail page, make some changes, Return to expense line page and here do SAVE. c) We have extended the DetailMainCO Can you please look into this and give some pointer? If possible please provide with your contact number. Thanks and Regards, Sai written by Anil Passi , February 28, 2007
hi sai
i believe u have checked that trigger does not reside on that table. If u remove ur controller extension, then does error disappear? also, check if the data is getting saved despite the exception error message? what exactly r u doing in CO extension. kindly email me DetailMainCO.java and also tthe base class email me those details and ur telephone number i need to check if extension can impact the link age between exp line and exp detail anilpassi at gmail dott com thanks anil written by sai , March 01, 2007
Hi Anil,
I posted a mail to your gmail account with details requested. Waiting for your response. Thanks and Regards, Sai written by Nagu , March 14, 2007
Hi,
I am trying to extend the Eo and VO in isupplier portal.I have brought the necessary files from java_top and kept in the jdev classpath.I am unable to load the respective bc4j package into my project as it does not contain server.xml file.It was directly loading the xml files into project.so now how do i extend the eo n vo plz help me....... thx nagu written by Anil Passi , March 15, 2007
hi Nagu
server.xml should be in /server directory. this is where AM and VO reside. Alternately, you can simply select the top directory and open the entire directory itself. jdev should build bc4j for you. if you get an error, then it will most probably be for some other dependent classes that are not in your classpath thanks anil written by Sakthi , May 07, 2007
Hi Anil,
I Need to customize a lot of seeded objects of a particular module(say AR).Please let me if I have to pull out all the objects for the complete module (say $JAVA_TOP/oracle/apps/AR) to my local system.Where do I place these files(In myprojects or myclasses). Thanks, Sakthi
Hi,
I am new to oracle applications Framework and i want to know bout property inspector's various field as i hav so many confusions. I searched for the document regarding this , but i didnt get any. If anyone can guide me in using efficiently the property inspector. Thanks, Anu.
very good, all your works are good.
but i want to know, where you are hosting your pages. is it free. please give me the link to the host company
Hi anil,
Today first time I am going through your site and I found it very useful for quick learning. But on some pages I am not able to view screen shots.
Anil,
Oracle doesnt recommend extending Controller. I am wondering why they suggest extension of VOs but not Controllers. I am assuming that personalizatins are mentioned even after upgrade. Any thoughts on this?
Hi Anil,
I have a very small doubt .. Please clarify it.. How can we call a custom jsp page from an OA page so that the jsp page should open in a new window. I tried many ways but it is geting opened in the same page itself. Kindly help me.. I am in need of it.. Thanks Vasantha
Hello Anil,
Can you please help me on this. I need to customize "Create Expense Report: General Information". I want the list for "Expense Template" to contain just the Expense Report Templates which are intended for the respective Employee Department. So, for any employee the Template list should contain all the Templates which belong to his department. Thanks, Sunil
Hi Anil,
We are trying to call a API in the GO button in Buyer Work Center -> Orders. For that we want to modify our Controller file by extending the existing controller file with the New Java class as per your steps in http://oracle.anilpassi.com/oa...ps-2.html. But while creating the Java class, it isnt accepting our existing Controller file(OrdersSummaryCO.java). The error says Not valid Base class for this operation. Please help me ASAP in this. Thanks a lot. Regards Devi You must be logged in to a comment. Please register if you do not have an account yet.
|
It is tough to debug without knowing the details of customizations that you have done.
Howeve, please check if you have any database trigger on AP_EXPENSE_REPORT_LINES_ALL
Thanks,
Anil