In this chapter , we will see how to create search page in OAF and how many different types of search pages in OAF.
we have 3 types of search pages in OAF.
Go to this Link LOV's (Inline LOV ,External LOV)
Result Based Search
Result base search will give the search results so the results whatever we are seeing in the page are just for display purpose we cannot select the resultant values like the way we select in Inline LOV or External LOV.
Steps to create result base search page
Step 1: Create Work space, project , AM and create one page assign AM to the page give page title and window title.
Manual Search Page
Manual search page we need to enter the data value to search for example employee name starting with 'A' then we used to type 'A%' in oracle apps forms similarly in OAF manual search page will work.
Create a page like Below.
Step 1) Create a page and attach AM
Step 2) Create VO and Attach AM
select * from Dept where Deptno =NVL(:1,Depnto) and Dname=NVL(:2,Dname) and Loc=nvl(:3,Loc)
Step 3) Create CO on main region and write below code in CO.
/*===========================================================================+
| Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
| All rights reserved. |
+===========================================================================+
| HISTORY |
+===========================================================================*/
package xxamw.oracle.apps.po.requisition.webui;
import amway.oracle.apps.po.requisition.webui.HelloWorldAMImpl;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
/**
* Controller for ...
*/
public class ManualSearchCO 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);
if(pageContext.getParameter("GO")!=null)
{
String dno = null;
String dname = null;
String loc = null;
OAApplicationModule am1=(OAApplicationModule)pageContext.getApplicationModule(webBean);
OAViewObject vo= (OAViewObject)am1.findViewObject("empDeptJoinVO1");
if(pageContext.getParameter("Deptno")!=null)
{
dno = pageContext.getParameter("Deptno").toString();
vo.setWhereClauseParam(0,dno);
}
else
{
vo.setWhereClauseParam(0,null);
}
if(pageContext.getParameter("Dname")!=null)
{
dname =pageContext.getParameter("Dname").toString();
vo.setWhereClauseParam(1,dname);
}
else
{
vo.setWhereClauseParam(1,null);
}
if(pageContext.getParameter("Loc")!=null)
{
loc = pageContext.getParameter("Loc").toString();
vo.setWhereClauseParam(2,loc);
}
else
{
vo.setWhereClauseParam(2,null);
}
vo.executeQuery();
}
if(pageContext.getParameter("CLEAR")!=null)
{
OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
OAMessageTextInputBean a1=(OAMessageTextInputBean)webBean.findIndexedChildRecursive("Deptno");
a1.setValue(pageContext,null);
OAMessageTextInputBean a2=(OAMessageTextInputBean)webBean.findIndexedChildRecursive("Dname");
a2.setValue(pageContext,null);
OAMessageTextInputBean a3=(OAMessageTextInputBean)webBean.findIndexedChildRecursive("Loc");
a3.setValue(pageContext,null);
}
}
}
we have 3 types of search pages in OAF.
- Automatic Search page
- Manual Search Page
- Result Based search page
- In Line LOV
- External LOV
Go to this Link LOV's (Inline LOV ,External LOV)
Result Based Search
Result base search will give the search results so the results whatever we are seeing in the page are just for display purpose we cannot select the resultant values like the way we select in Inline LOV or External LOV.
Steps to create result base search page
Step 1: Create Work space, project , AM and create one page assign AM to the page give page title and window title.
Step 2: Create
new VO in respective BC4J, generally List of Values ends with VO and the
example BC4J path is:
Package (BC4J) : xxresultbasesearch.oracle.apps.po.inlineprj.server
VO name : ResultBaseSearchVO
SELECT VENDOR_NAME,VENDOR_ID FROM AP_SUPPLIERS.
Step 3: Attach VO to the AM
Step 4:- After creating VO and attaching it to AM, in this step create new region
under main region and select the region style in property inspector as Query.
It means we need to create a Query region under the main region.
After creating Query Region
in main region select the Query Region property Inspector and in Property
Inspector select Construction Mode as Result Base search as shown in the below
figure:
Now in the page structure
select the Query region, right click on the Query region select New ->
Region Using Wizard…
Step5:- Run the
page and see the output, if we observe in the output the Query region creates
automatically Go and Clear buttons.
Manual search page we need to enter the data value to search for example employee name starting with 'A' then we used to type 'A%' in oracle apps forms similarly in OAF manual search page will work.
Create a page like Below.
Step 1) Create a page and attach AM
Step 2) Create VO and Attach AM
select * from Dept where Deptno =NVL(:1,Depnto) and Dname=NVL(:2,Dname) and Loc=nvl(:3,Loc)
Step 3) Create CO on main region and write below code in CO.
/*===========================================================================+
| Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
| All rights reserved. |
+===========================================================================+
| HISTORY |
+===========================================================================*/
package xxamw.oracle.apps.po.requisition.webui;
import amway.oracle.apps.po.requisition.webui.HelloWorldAMImpl;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
/**
* Controller for ...
*/
public class ManualSearchCO 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);
if(pageContext.getParameter("GO")!=null)
{
String dno = null;
String dname = null;
String loc = null;
OAApplicationModule am1=(OAApplicationModule)pageContext.getApplicationModule(webBean);
OAViewObject vo= (OAViewObject)am1.findViewObject("empDeptJoinVO1");
if(pageContext.getParameter("Deptno")!=null)
{
dno = pageContext.getParameter("Deptno").toString();
vo.setWhereClauseParam(0,dno);
}
else
{
vo.setWhereClauseParam(0,null);
}
if(pageContext.getParameter("Dname")!=null)
{
dname =pageContext.getParameter("Dname").toString();
vo.setWhereClauseParam(1,dname);
}
else
{
vo.setWhereClauseParam(1,null);
}
if(pageContext.getParameter("Loc")!=null)
{
loc = pageContext.getParameter("Loc").toString();
vo.setWhereClauseParam(2,loc);
}
else
{
vo.setWhereClauseParam(2,null);
}
vo.executeQuery();
}
if(pageContext.getParameter("CLEAR")!=null)
{
OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
OAMessageTextInputBean a1=(OAMessageTextInputBean)webBean.findIndexedChildRecursive("Deptno");
a1.setValue(pageContext,null);
OAMessageTextInputBean a2=(OAMessageTextInputBean)webBean.findIndexedChildRecursive("Dname");
a2.setValue(pageContext,null);
OAMessageTextInputBean a3=(OAMessageTextInputBean)webBean.findIndexedChildRecursive("Loc");
a3.setValue(pageContext,null);
}
}
}
Run the page and see the output.
No comments:
Post a Comment