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");
oasb.setID("xxSubmitSendEmailButton");
oasb.setUINodeName("xxSubmitSendEmailButton");
oasb.setEvent("xxSubmitSendEmailButton");
oasb.setText("xxSubmitSendEmailButton");
webBean.addIndexedChild(oasb);
}
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 e-mail address is being protected from spambots. You need JavaScript enabled to view it
;
This e-mail 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
<head>
<script type="text/javascript">
function xxRzbCallEmail(paramEmailLearner){
document.location.href='MailTo:'+paramEmailLearner;history.go(-1);
}
</script>
</head>
<%
String paramEmailLearner = request.getParameter("paramEmailLearner");
System.out.println ( "paramEmailLearner=>" + paramEmailLearner ) ;
%>
<body onload=xxRzbCallEmail("<%=paramEmailLearner%>")>
</body>
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
written by Suneetha , January 17, 2008
written by manikandan , January 24, 2008
I am trying to convert the account values from legacy to oracle base tables(fnd_flex_values,fnd_flex_values_tl).The 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.
written by Luckoteea , January 25, 2008
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...
Thanks
rajiv
written by Tapash Ray , February 14, 2008
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.
Tapash
written by Zafar Sadiq , March 07, 2008
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
Thanks
written by Kuldeep , September 01, 2008
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.
Thanks
Kuldeep Singh
written by Anil Passi-- , September 01, 2008
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
Thanks
Anil
written by Kuldeep , September 02, 2008
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.........
written by Kuldeep , September 02, 2008
I got this code..........Is this ok...........
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 e-mail address is being protected from spambots. You need JavaScript enabled to view it '> This e-mail address is being protected from spambots. You need JavaScript enabled to view it his e-mail add***s is being protected from spambots. You need JavaScript enabled to view it ; This e-mail address is being protected from spambots. You need JavaScript enabled to view it '> This e-mail address is being protected from spambots. You need JavaScript enabled to view it his e-mail add***s 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
}}
Thanks
written by Ingo , February 09, 2009
Create a normal button by personalization. Export the personalization.
Replace the button by submitButton and delte unused attributes
import personalization. Bingo
written by avb , February 09, 2010
I need assistance from U regarding Checkbox properties.
Actually 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 ????
written by Kalvin , March 30, 2010
Thanks
written by Swadhin Sangram Swain , June 17, 2011
written by Hosam , August 02, 2011
i flow the previous steps to create submit button in extended controller and i got error
WebBean style not supported
written by Dominic Ayalogu , December 13, 2011
super.processRequest(oapagecontext, oawebbean);
OAWebBeanDateField enddate = (OAWebBeanDateField)oawebbean.findIndexedChildRecursive("HrSitEndDate");
OASubmitButtonBean oasb= (OASubmitButtonBean)oapagecontext.getWebBeanFactory().createWebBean(oapagecontext,"BUTTON_SUBMIT");
oasb.setID("Calc");
oasb.setUINodeName("xxCalculate");
oasb.setEvent("xxCalculate");
oasb.setText("Calculate Days and Amount");
enddate.addIndexedChild(oasb);
Please can somebody explain to me why the code did not create the button as expected
kind Regards
Dominic
| < Prev | Next > |
|---|





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,
Suneetha.