Co Ext
Co Ext
Co Ext
Exmaple 2_
Oracle does not recommend that customers extend controller objects associated with regions or
webbeans in shipped E-Business Suite product pages.
Controller class (oracle.apps.fnd.framework.webui.OAControllerImpl) methods should
effectively be considered private, since their implementation is subject to change. Controller
extensions are therefore not considered to be durable between upgrades.
If it is absolutely essential to handle custom form submit events on a shipped product page,
processFormRequest() is the only method that should be overriden in a controller class,
although the risks outlined above still apply.
Now for knowing which controller to extend we click on "About This Page" Link and select
Expand All. Here we can see the Name of the controller that we need to extend
Note -- Give the Name of your Extended Class give its package path and in the extends property
select base class
Note -- If you are not able to see this link then go through below link –
https://blogs.oracle.com/prajkumar/entry/how_to_enable_personalization_link
Click on Complete View -> Expand All -> Click on personalize icon next to Page Layout
Now at site level give the path of extended controller as we are extending the controller at SITE
LEVEL
prajkumar.oracle.apps.fnd.coextensiondemo.webui.ExtendedCO
5. Congratulation you have successfully finished. Run Your SearchPG page and Test Your
Work
Click Go
Note – Record with Column1 value val5 and Column2 value val6 is not coming in result
How to extend a standard controller CO?
I have a standard page in HRMS module and have a business requirement to have additional check(Validations) to
be performed before i click Transfer button. Transfer button Will have a standard controller.
Note: FND: Diagnostics (FND_DIAGNOSTICS) profile option to Yes to render the "About this page" link at the bottom
of each OA Framework-based page.
package xx.oracle.apps.per.wpm.objectives.webui;
import com.sun.java.util.collections.HashMap;
import java.io.Serializable;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
import oracle.apps.per.selfservice.common.SSHRParams;
import oracle.jbo.domain.Number;
import oracle.apps.per.wpm.objectives.webui.*;
import oracle.apps.fnd.framework.OAFwkConstants;
import oracle.apps.fnd.framework.server.OADBTransaction; //to establish DB connection
import java.sql.CallableStatement; //to execute a package.procedure
import java.sql.Types;//used for type conversions and VARCHAR2
public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
{
String p_return_msg = null;
if(oapagecontext.getParameter("MgrTransfer") != null) //This is the Transfer Button ID name
{
OADBTransaction tx = oapagecontext.getRootApplicationModule().getOADBTransaction();
String sql="BEGIN " +
"XXValidateProc("+
"p_param_1=> :1,"+
"p_return_msg => :2);"+
" END;";
CallableStatement cStmt = (CallableStatement)tx.createCallableStatement(sql, 1);
if(cStmt!=null)
{
try {
cStmt.setString(1,oapagecontext.getDecryptedParameter("p_param_1"));
cStmt.registerOutParameter(2,Types.VARCHAR);
cStmt.execute();
p_return_msg = cStmt.getString(2);
cStmt.close();
}
catch(Exception e)
{
throw new OAException("SBM: Error Calling XXValidateProc" + e.toString(),OAException.ERROR);
}
}
if(!p_return_msg.equalsIgnoreCase("No Errors")){
throw new OAException(p_return_msg,OAException.ERROR);
}
else
{
super.processFormRequest(oapagecontext, oawebbean);
}
}
else
{ //In case of any exception in the custom procedure, I want the standard controller method's to be called.
super.processFormRequest(oapagecontext, oawebbean);
}
}
}
Migration of OA Controller Extension
Go to The regions where controller is got extended. Inherit the Controller location as
xx/oracle/apps/per/wpm/objectives/webui/XXSetObjectivesPageCO