OA Framework Extending Controller
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 "oracle.apps.ak.extendCO.extendedHelloCO" at Site level.
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.
Comments
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_REPO RT_LINES_ALL
Thanks,
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:
Una ble 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
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 ProcessFormRequ est is called >
2) Then RootApplication Module: WebExpensesAM invokes Method: SaveExpenseRepo rtFromWeb
3) Which in turn invokes the Method: SaveExpenseRepo rt
4) In Method: SaveExpenseRepo rt the code - OADBTransaction Impl.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.
Than ks and Regards,
Sai
i believe u have checked that trigger does not reside on that table.
If u remove ur controller extension, then does error disappear?
a lso, check if the data is getting saved despite the exception error message?
wha t exactly r u doing in CO extension. kindly email me DetailMainCO.ja va 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
I posted a mail to your gmail account with details requested.
W aiting for your response.
Th anks and Regards,
Sai
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
server. xml should be in /server directory. this is where AM and VO reside.
Alte rnately, 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
th anks
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/oracl e/apps/AR) to my local system.Where do I place these files(In myprojects or myclasses).
Thanks,
Sakthi
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.
Tha nks,
Anu.
In jDeveloper, Jut hit F1 key when your cursor is on property inspector. Each property is well documented.
Th anks,
Anil
but i want to know, where you are hosting your pages. is it free.
please give me the link to the host company
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.
Your ISP must be blocking docs.google.com
The images are hosted on google docs.
Thanks
A nil Passi
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?
You will find the answer in this link www.google.com/search?q=site:apps2fusion.com+controller-extension-in-oa-framework-is-safe-or-unsafe
Thanks,
Anil Passi
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
You can set Target Frame = _blank.
Please see the image below.
Thanks,
Anil Passi
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.
Th anks,
Sunil
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://www.google.com/search?q=site:apps2fusion.com+oa-framework-extending-controller-steps
But while creating the Java class, it isnt accepting our existing Controller file(OrdersSumm aryCO.java). The error says Not valid Base class for this operation.
Plea se help me ASAP in this.
Thanks a lot.
Regards
D evi
I would like to see your custom controller class.
Email me the same
Thanks
An il
We have a requirement to set the lov to some default value which can not be done by VO change. So, we need to customize TimecardCO.java . We have done the change and timebeing we have replaced the customized class.
Do we have any otherway to substitute the original CO with custom CO?
Thanks
Rao
I have extended the existing CO by creating a new java class.
I am not able to generate the classn file of the extended CO that is the new one.
Please its a bit urgent issue. How can i possiblly generate the class file for this.
while compiling it does not gives any error still class file is not getting generated.
Kri tika
Could not create java class...
kindl y help me regarding this.
kritika
I get the below error when I compile my script while trying to extend CO....
Could anyone check and let me know what needs to be done....
Error (10,42): IrcOAController Impl not found in class oracle.apps.irc .candidateSelfS ervice.webui.Em pJobSearchCO in class keane.oracle.apps.irc .candidateSelfS ervice.webui.Em pJobSearchCO_8393
Thanks
if you have any link there, of the first step of extending controllers, please let me know.
thanks in advance!!!
Pabl o.
Could not create java class...
kindl y help me regarding this.
RSS feed for comments to this post