Fusion Blog

EBS Blog


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 Click here to raise Support Ticket. Get reply within 48 hours.

Search Courses

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
In continuation with previous article, please find a sample source code for enabling a Submit Button on OA Framework Page.
This code will reside in Controller class.

Following sequence of events will take place for this type of extension
The extended custom controller class will replace the standard controller class.
Just prior to the page being rendered, processRequest of extended controller will be called.
In processRequest we will create a Submit Button Bean using getWebBeanFactory(),as in sample below.
Next, we will attach an event named "xxSubmitSendEmailButton" to this newly created button.
In the processFormRequest of extended controller, trap the event named "xxSubmitSendEmailButton"
Note- Event is trapped by checking the value of pageContext.getParameter(EVENT_PARAM)
Take appropriate action when this event is trapped

The actual code related to button is colour codedin brownish text

//add these import, if not already exist
import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;

//First create the Submit Button
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
//first excute standard functionality by call super as below
super.processRequest(pageContext, webBean);
//now create new button programatically
OASubmitButtonBean oasb= (OASubmitButtonBean)pageContext.getWebBeanFactory().createWebBean(pageContext,"BUTTON_SUBMIT");

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
String strEvent= pageContext.getParameter(EVENT_PARAM) ;

if ( strEvent.equals("xxSubmitSendEmailButton"))
//IMPORTANT Get this by calling the Function that loops for records.
//The string will contain the concatenation Email for which STANDARD CHECKBOX WAS CHECKED
String strEmailStringLearner = "This email address is being protected from spambots. You need JavaScript enabled to view it.;This email address is being protected from spambots. You need JavaScript enabled to view it." ;
pageContext.setForwardURL("xxMailOTA.jsp?paramEmailLearner="+ strEmailStringLearner,
null, // not necessary with KEEP_MENU_CONTEXT
OAWebBeanConstants.KEEP_MENU_CONTEXT, // no change to menu context
null, // No need to specify since we're keeping menu context
null, // request parameters
true, // retain the root application module
OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // display breadcrumbs
OAException.ERROR); // do not forward w/ errors

3. On your PC, in <JDEV_USER_HOME>/myhtml/OA_HTML
create a jsp file xxMailOTA.jsp, with below contents
<script type="text/javascript">
function xxRzbCallEmail(paramEmailLearner){

String paramEmailLearner = request.getParameter("paramEmailLearner");
System.out.println ( "paramEmailLearner=>" + paramEmailLearner ) ;
<body onload=xxRzbCallEmail("<%=paramEmailLearner%>")>

IMPORTANT NOTE: This will be deployed to the $OA_HTML on server, when testing from eBusiness Suite

Overall Flow for business case
1. The processRequest of Controller will create a Submit Button, as it can't be done using Personalization.
2. In processFormRequest of Controller, when Submit Button is clicked, the value in StandardCheckbox will go into the corresponding View Object Attribute
3. We will loop for those records and calculate Concatenated Email String strEmailStringLearner
4. On Submission of Page, we will call xxMailOTA.jsp
5. xxMailOTA.jsp will do two things
a. Invoke MailTo on load of the jsp page
b. Send the navigation back to the main page

Anil Passi


0 #1 Suneetha 2008-01-17 11:18
Hi Anil,

As always great stuff.. I have one question though.. How do you specify, if you want the button to be created at a specific location ( may ne next to a set of buttons which are already on the standard page)..

Thanks for all your help,
0 #2 Anil Passi 2008-01-17 11:28
Hi Suneetha

In the above sample, we are using webBean.addInde xedChild(oasb)
This means that button will be added at the end of the page itself.

Howeve r, instead, you could also do, anyBeanOnPage.a ddIndexedChild( oasb)
You can add further parameters to addIndexedChild , so as to dictate the position within the parent container.

For example, a pseudo code is

Main Page Bean Structure
StackLayout for Buttons

====== =============== ======

//Firs t locate StackLayout for Buttons
------- --------------- -
OAStackLayout Bean oslb=(OAStackLa youtBean)webBea n.findIndexChil dRecursive("nam e of stacklayoutbean ");

//Next add the button to existing stacklayout which contains all existing buttons
oslb.ad dIndexedChild(n ewButtonbeanHer e)

In real world though, container for buttons may or may not be stack layout
Anil Passi
0 #3 venkat 2008-01-24 13:02
Dear Anil,
I am trying to convert the account values from legacy to oracle base tables(fnd_flex _values,fnd_fle x_values_tl).Th e problem is we could not load the segment qualifiers from the legacy table to base table.It is not displaying in front end.We are using R12.Please solve my problem.
0 #4 Siva Sankara Rao Pamarthi 2008-01-25 11:29
Hi Anil,
I am looking for Oracle Application documentation in French, can you help out, where I can get these documents, like user manuals, setup manuals, etc...
r ajiv
0 #5 Tapash Ray 2008-02-14 19:23
Just wanted to add the reason why SubmitButton cannot be added via personalization .
Think of it this way, even if we were able to add a submit button, what would we be able to achieve ?
Since we would want to call a piece of logic when the form is submitted using the SubmitButton, we would anyway need to customize the controller, and since we are customizing the controller, we can create the button there itself.

0 #6 Anil Passi 2008-02-14 19:59
Hey Tapash

As always, you are spot on.

Ani l Passi
0 #7 Zafar Sadiq 2008-03-07 05:57
Hi Anil ,
Is it possible to handle Key Board ENTER key through code . For example : if user press Enter key i want certain events to be handled or navigate to other page

0 #8 Kuldeep 2008-09-01 01:09
Hi Anil,
You have done a tremendous job. I learnt a lot from this site.
I want to implement that when any record is deleted say from table a mail is sent to that person. I tried the above written code on this site but not getting the result what i want.

K uldeep Singh
0 #9 Anil Passi-- 2008-09-01 05:48
Hi Kuldip

First you need to check if there is any business event that fires when record gets deleted.
Next check if there is any custom API Hook which oracle calls
If not, then, you may extend Entity object, and override method deleteRow()
in DeleteRow, you will first call super.deleteRow and then call an email api

Ani l
0 #10 Kuldeep 2008-09-02 01:07
Hi Anil,
Actually an event is fired when the record is deleted. In this case what i have to do.
Can u suggest me some code for this.........
0 #11 Kuldeep 2008-09-02 01:08
Hi Anil,
I got this code..........I s this ok...........

public void processFormRequ est(OAPageConte xt pageContext, OAWebBean webBean)
supe r.processFormRe quest(pageConte xt, webBean);
Strin g strEvent= pageContext.get Parameter(EVENT _PARAM) ;

if ( strEvent.equals ("xxSubmitSendE mailButton"))
//IMPORTANT Get this by calling the Function that loops for records.
//The string will contain the concatenation Email for which STANDARD CHECKBOX WAS CHECKED
String strEmailStringL earner = " his e-mail address is being protected from spambots. You need JavaScript enabled to view it ; his e-mail address is being protected from spambots. You need JavaScript enabled to view it " ;
pageContext.s etForwardURL("x xMailOTA.jsp?pa ramEmailLearner ="+ strEmailStringL earner,
null, // not necessary with KEEP_MENU_CONTE XT
OAWebBeanCon stants.KEEP_MEN U_CONTEXT, // no change to menu context
null, // No need to specify since we're keeping menu context
null, // request parameters
true , // retain the root application module
OAWebBea nConstants.ADD_ BREAD_CRUMB_YES , // display breadcrumbs
OAE xception.ERROR) ; // do not forward w/ errors

Than ks
0 #12 Ingo 2009-02-09 08:43
it is possible to add a button.

Create a normal button by personalization . Export the personalization .

Replace the button by submitButton and delte unused attributes

import personalization . Bingo
0 #13 avb 2010-02-09 11:56
Hi.... I'm new to this ORACLE.
I need assistance from U regarding Checkbox properties.

Ac tually I can able to display series of checkboxes along with some colomns by using wizard. but the problem for me is that, when I clicked some perticular chekboxes, I want to get corresponding records details only.... but I'm not getting hw to do this. Can U help me ????
0 #14 Kalvin 2010-03-30 09:02
I would like to know how to default the value of a checkbox to ticked, so that I can then make it read only. Usually for initial values, you just enter the value it displayes in the fileld, but what is the rule for checked boxes,. e.g In Contracts Provisions - checkbox to show ticked and then read only, so that when attached to a resposnbility it only displays those clauses with provisions.
0 #15 Swadhin Sangram Swain 2011-06-17 02:35
I'm new to OAF. I have added a submit button on Finish Objective Setting page. Now button is there and working but now other buttons are giving error (nullpointer etc) .
0 #16 Hosam 2011-08-02 10:06
i flow the previous steps to create submit button in extended controller and i got error
WebBean style not supported
0 #17 Dominic Ayalogu 2011-12-13 14:01
I typed the following code to create a button dynamically on my page but it didn't create any button as expected

super .processRequest (oapagecontext, oawebbean);
OAWebBeanDateFi eld enddate = (OAWebBeanDateFi eld)oawebbean.findIndexedChildRecursive("HrSitEndDate");
OASubmitButtonB ean oasb= (OASubmitButtonB ean)oapagecontext.getWebBeanFactory().createWebBean(oapagecontext,"BUTTON_SUBMIT");
oasb.setID("Cal c");
oasb.setUINodeN ame("xxCalculat e");
oasb.setEvent(" xxCalculate");
oasb.setText("C alculate Days and Amount");
enddate.addInde xedChild(oasb);

Please can somebody explain to me why the code did not create the button as expected

kind Regards

Domini c

Add comment

Security code

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Jun 2021  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
   1  2  3  4  5  6
  7  8  910111213

Enquire For Training

Fusion Training Packages

Get Email Updates

Powered by Google FeedBurner