Apps - OA Framework Extending Controller - Steps Page 1 of 8
OA Framework Extending Controller - | Print |
Steps
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:-
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-
cut-down version of helloWorld.
Estimated time:-
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"
http://oracle.anilpassi.com/index2.php?option=com_content&task=view&id=103&pop=1... 10/30/2007
Apps - OA Framework Extending Controller - Steps Page 2 of 8
Note:-
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.
2 Add the highlighted lines to extendedHelloCO.java
package oracle.apps.ak.extendCO;
import oracle.apps.ak.hello.webui.MyTestCO;
http://oracle.anilpassi.com/index2.php?option=com_content&task=view&id=103&pop=1... 10/30/2007
Apps - OA Framework Extending Controller - Steps Page 3 of 8
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.
This completes the exercise for the extension of a Controller in OA Framework [OAF].
Comments (15)
Subscribe to this comment's feed
...
written by Anil Passi , February 19, 2007
http://oracle.anilpassi.com/index2.php?option=com_content&task=view&id=103&pop=1... 10/30/2007
Apps - OA Framework Extending Controller - Steps Page 4 of 8
Hi Sai
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
...
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.
http://oracle.anilpassi.com/index2.php?option=com_content&task=view&id=103&pop=1... 10/30/2007
Apps - OA Framework Extending Controller - Steps Page 5 of 8
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?
http://oracle.anilpassi.com/index2.php?option=com_content&task=view&id=103&pop=1... 10/30/2007
Apps - OA Framework Extending Controller - Steps Page 6 of 8
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.
http://oracle.anilpassi.com/index2.php?option=com_content&task=view&id=103&pop=1... 10/30/2007
Apps - OA Framework Extending Controller - Steps Page 7 of 8
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
...
written by anu , August 01, 2007
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.
...
written by Anil Passi , August 01, 2007
Hi Anu,
In jDeveloper, Jut hit F1 key when your cursor is on property inspector. Each
property is well documented.
Thanks,
Anil
...
written by zamora , September 05, 2007
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
http://oracle.anilpassi.com/index2.php?option=com_content&task=view&id=103&pop=1... 10/30/2007
Apps - OA Framework Extending Controller - Steps Page 8 of 8
...
written by Mail , September 23, 2007
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.
...
written by Anil Passi , September 24, 2007
Hi Mail
Your ISP must be blocking http://docs.google.com
The images are hosted on google docs.
Thanks
Anil Passi
...
written by Amol , September 24, 2007
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?
...
written by Anil Passi , September 24, 2007
Hi Amol
You will find the answer in this link http://oracle.anilpassi.com/co...nsafe.html
Thanks,
Anil Passi
Close Window
http://oracle.anilpassi.com/index2.php?option=com_content&task=view&id=103&pop=1... 10/30/2007