Wednesday, June 15, 2016

Manual Search

In this lesson we are going to see how to create manual search page in OAF manually. Manual Search page we need to enter the data value to search for example employee names starting with ‘A’ then we used to type A% in oracle apps forms similarly in OAF the manual search page will work like.
Step 1: Create Workspace, project , AM and create one page assign AM to the page give page title and window title.
For example :
workspace name : ManualSearch
Project Name : ManualSearchPRJ
package name : xxmanualsearch.oracle.apps.po.manualsearchprj.webui
AM name : ManualSearchAM
AM Package name: xxmanualsearch.oracle.apps.po.manualsearchprj.server
Step 2:-  Create VO and attach VO to AM
VO Name is : ManualsearchVO

select customer_name from ra_customers where customer_name LIKE NVL(:1, customer_name)

Step 3:-  The below picture shows the requirement so there fore we need to create a page to achieve the requirement.


Now if we observe the above image we need to create three Message Text Input items for search and two button items.
After entering data in Message Text Input items and once we click on Go button then according to the search item provided the resultant values must be displayed in the below table region.
steps to construct the page like above picture:
step 1: Create one message component layout region
step 2: Under message component layout region create three message text input items.
step 3: Create one Row Layout Region under main region, under Row Layout Region create twoSubmit buttons and if we want a space between two buttons then create one Spacer item between two submit button items.
step 4: Create one region using wizard and select region style as Table, select proper package name in which we created VO (ManualsearchVO).
After creating all the page structure may look like :


Step 4:- Open the java file of AM and create one method in AM and write the logic.

  public void xxSearchParams(OAPageContext pc,OAWebBean wb)
  {
    String cn=null;
    
    OAViewObject vo=getMan_VO1();
    if(pc.getParameter("item3")!=null)
    {
      cn=pc.getParameter("item3").toString();
      vo.setWhereClauseParam(0,cn);
          }
          else
          {
            vo.setWhereClauseParam(0,null);
          }
          vo.executeQuery();
  }


Step 5:-  Create the controller and write the logic for buttons in Process Form Request of controller and here is the logic.

  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
    searchAMImpl am=(searchAMImpl)pageContext.getApplicationModule(webBean);
    
  if(pageContext.getParameter("item4")!=null)
  {
    am.xxSearchParams(pageContext,webBean);
  }
  if(pageContext.getParameter("item6")!=null)
{
  OAMessageTextInputBean msb=(OAMessageTextInputBean)webBean.findChildRecursive("item3");
  msb.setValue(pageContext,null);
}
    
Step 6:- After writing logic in AM and Controller rebuild the code and run the page to see the output.
The resultant page may look like the following figure:
(1)
(2)
(3)
(4)

END












No comments:

Post a Comment