OAF Search Page AM Code-Oracle Apps Technical

By Jag - April 14, 2014
This is the Application Module code. 

package Test3.oracle.apps.ap.suppliers.server;

import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;

// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class Test3AMImpl extends OAApplicationModuleImpl {
    /**This is the default constructor (do not remove)
     */
    public Test3AMImpl() {

    }

    /**Sample main for debugging Business Components code using the tester.
     */
    public static void main(String[] args) {
        launchTester("Test3.oracle.apps.ap.suppliers.server", /* package name */
      "Test3AMLocal" /* Configuration Name */);
    }

  /**Container's getter for JaganTestVO1
   */
  public Test3VOImpl getTest3VO1()
  {
    return (Test3VOImpl)findViewObject("Test3VO1");
  }
  
  public void Test3a(String Vendorid)
  //Here Test3a is a method defined and called it in Test3CO.java
  {
    Test3VOImpl ab=getTest3VO1();
    ab.setWhereClause(null);
    ab.setWhereClauseParam(0,Vendorid);
  //ab.addWhereClause("vendor_id="+vendorid);
  // System.out.println(ab.getQuery());-- This is to print query in oaf builder while running.
    ab.executeQuery();
  }
}

OAF Search Page CO Code


created simple search page in OAF for Vendor details.

If we give vendor Id then it will display Vendor name, Vendor Id and Vendor Number.

Here is the Controller code.

/*===========================================================================+
 |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
 |                         All rights reserved.                              |
 +===========================================================================+
 |  HISTORY                                                                  |
 +===========================================================================*/
package Test3.oracle.apps.ap.suppliers.webui;

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 Test3.oracle.apps.ap.suppliers.server.Test3AMImpl;
import java.io.Serializable;

/**
 * Controller for ...
 */
public class Test3CO extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
  }

  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{ super.processFormRequest(pageContext, webBean); 
    String VendorId = null;
    if (pageContext.getParameter("Go")!=null)
    {
    VendorId=pageContext.getParameter("vendorId"); //This is the ID of search box
    }
    
    Test3AMImpl av=(Test3AMImpl)pageContext.getApplicationModule(webBean);
    Serializable params [ ]={VendorId};
    av.invokeMethod("Test3a",params); //Here calling method from AM
    
         if (pageContext.getParameter("Clear")!= null)
    {
      pageContext.forwardImmediatelyToCurrentPage(null, false, null);
    }

}
}


  • Share:

You Might Also Like

0 comments