Showing posts with label Controller Extension in OAF. Show all posts
Showing posts with label Controller Extension in OAF. Show all posts

Monday, 25 June 2018

Migration of controller extension in oaf

Migration of controller extension in oaf

In this post, I am sharing the steps to Migrate Controller Extension in OAF.  First we need to identify , the Standard controller Which we want to Extend. Then after that , we can follow these below steps to controller Migration in OAF. 
 
1.First identify the name of the controller to know the Controller name go to the About this Page of the Oaf page, then under this , Business Components , go to controller tab to know the exact name path of the controller to download this file from Application Java_Top to in our Local System.
 
2. We will extend this controller in the J-Developer.
 
3.Once we have created the extended controller in the j-Developer , then we will move this Extended Controller in the Server under Java_Top.
4.Suppose I have created Extended Controller in the Path 'oracle/apps/xxap/oie/webui/ExpenseReportCOEx' and then we will create the same path in the server under Java_Top/oracle/apps/xxap/oie/webui and put the Extended Controller in the 'ExpenseReportCOEx'  in Java_Top/oracle/apps/xxap/oie/webui
 
 
5.Now We have created the Java class file to extend the Standard Java Class.
After that We need to Put this Extended JavaClass'ExpenseReportCOEx' under Java_Top.
Server Path:- Java_top/Oracle/apps/xxap/oie/webui
 
Step23:- Now again go Back to the Web page in application where we want to do this Controller Extension. Now Click on the 'Personalize Page' Highlighted below. 
 

 
Migration of controller extension in oaf
 
 
 
Step24:- Now go to update Personalization under Header of your OAF page.
 
Migration of controller extension in oaf
 
 
Step25:-
Now put the location of your Extended Controller under CO field in the Personalize page.
Extended Controller Location :Oracle.apps.xxap.oie.webui.ExpenseReportCOEx
 

If you want to learn the Controller Extension steps in Detail You can go to the Below Link.

 




 

Migration of controller extension in oaf
 

Tuesday, 27 March 2018

How to Create Button in OAF Page Programmatically or Dynamically.

How to Create Button in OAF Page Programmatically or Dynamic

This is recommendable by Oracle to do no changes in the OAF page directly. To make nay direct changes in the OAF standard page is not advisable by the Oracle but some time , We need to do changes in the Page layout to match the business requirement. For these kind of scenarios , We can change the page layout through Controller Extensions and with the Help of OAF Personalizations. In this Post , I will show you , how we can create OAF Submit button in OAF Page through Controller Extension. I an sharing the controller code to create the Button in OAF Page Programmatically or Dynamically.
 
You have to Put this code under processRequest() method of your Controller.
 
How to Create Button in OAF Page Programmatically or Dynamically.
 

How to Create Button in OAF Page Programmatically or Dynamic

 
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{

super.processRequest(pageContext, webBean);



OASubmitButtonBean NewSubmitButton= (OASubmitButtonBean)pageContext.getWebBeanFactory().createWebBean(pageContext,"BUTTON_SUBMIT");

 subBtn.setID("NewSubmitButton");
subBtn.setUINodeName("NewSubmitButton");
subBtn.setEvent("Submit");
subBtn.setText("Go ");  /*Go will be displaced on this Button' You can also write other Buttons too.
 RegionName.addIndexedChild(NewSubmitButton); /*This code will add the Go button in the Page Region. RegionName is the Actual name of your OAF Page Region'


}
 
 
How to Create Button in OAF Page Programmatically or Dynamically.

 

Saturday, 24 March 2018

Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event

Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event

We need Controller Extension when we want to add custom Validations and to add extra monitoring in the Standard process or to Control the Standard Page behavior  then we do Controller Extensions to achieved this requirement. We can control the functionality of the Page through Controller codes and if we want to control the Standard OAF pages then we do OAF Controller Extensions.
 
This is the Second Part of OAF controller Extension. We have already created a OAF project in the J-Developer and now in the Post , we will start doing Controller Extension in this Project.
 
Here below is the First part of this Topic.
 

Step13:- Creation Controller Extension

Now right Click on the Project as below and click New.
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event

 
Step14:- Now Create Java Class as below
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event
 
 
Step15:- Create Extended Controller Name and select the Package.
Now select the Standard Controller which you want to Extend Click on the Browse Button under Extends as below and Select the Standard Controller 'TrackExpesneReportsCO'  which we want to Extend in this Controller Extension.
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event
 
Step16:- Select the same path under which your Standard Controller Placed in the Jdevhome folder MyProjects folder.
 
Like oracle/apps/ap/oie/webui
 
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event
 
 
Step17:- Select the 'TrackExpesneReportsCO' Standard Page Controller.
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event
 
 
Step18:-  Java Class values and Click Ok.
 
 
Step19:- Here below your Extended Java Class 'ExpenseReportCOEx' has been created Below. We will write the code to extend standard OAF page under this Java class.
 
 
Step20:- OAF Code of this Extended Java Class as below:
 
 
package oracle.apps.xxap.oie.webui;
import java.sql.SQLException;

public class ExpenseReportCOEx extends TrackExpenseReportsCO {
    public ExpenseReportCOEx() {
    }
   
    public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
       {
         super.processRequest(paramOAPageContext, paramOAWebBean);
       } 
      
    public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
       {
            Number ReportHeader;
               if ("WithdrawReport".equals(paramOAPageContext.getParameter("event")))
                      {
                          paramOAPageContext.writeDiagnostics(this, "Clicked on withdraw ", 1);
                      }
                     
    if (paramOAPageContext.getParameter("CommitWithdraw") != null)
           {       
           paramOAPageContext.writeDiagnostics(this, "Selected Yes to withdraw ", 1);
            OAApplicationModule am = (OAApplicationModule)paramOAPageContext.getApplicationModule(paramOAWebBean);
            OADBTransaction txn = am.getOADBTransaction();
            String str="BEGIN xx_insert_withdrawactions.insertrow(P_Header_id => :1);END;";
            OracleCallableStatement Callstmt=(OracleCallableStatement)txn.createCallableStatement(str,1);
            String Result = "";
    try{
                ReportHeader = new Number(paramOAPageContext.getDecryptedParameter("ReportHeaderId"));
              
           
                 String RptHdrId = ""+ReportHeader;
             Callstmt.setString(1,RptHdrId);
         
             Callstmt.execute();
       
                 paramOAPageContext.writeDiagnostics(this, "xx_insert_withdrawactions proc completed Successfully ", 2);        
             Callstmt.close();
             }   
    catch(SQLException sqle){
                 paramOAPageContext.writeDiagnostics(this, "Exception in calling sqlstatement  "+sqle, 2);        
             try { Callstmt.close(); } catch (Exception e) {
                 paramOAPageContext.writeDiagnostics(this, "Exception in calling sqlstatement  "+sqle, 2);        
             }
             }
            }
            super.processFormRequest(paramOAPageContext, paramOAWebBean);         
           
           
        }      
            
           
}
 
Step21:- Now right Click on this Java class to compile this code. Click Rebuild to compile this Class.
 
 
 
Step22:- Now We have created the Java class file to extend the Standard Java Class.
After that We need to Put this Extended JavaClass'ExpenseReportCOEx' under Java_Top.
Server Path:- ava_top/Oracle/apps/xxap/oie/webui
 
Step23:- Now again go Back to the Web page in application where we want to do this Controller Extension. Now Click on the 'Personalize Page' Highlighted below.
 
 
 
 
 
 
Step24:- Now go to update Personalization under Header of your OAF page.
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event
 
 
Step25:-
Now put the location of your Extended Controller under CO field in the Personalize page.
Extended Controller Location :Oracle.apps.xxap.oie.webui.ExpenseReportCOEx
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event

 

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *