mobileNavlogo
headerlogo

Blog

Manual Search

25 October, 2018

Related Blogs

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 Query in the VO is :- SELECT * FROM dept WHERE deptno LIKE NVL(:1, deptno) AND dname LIKE NVL (:2, dname) AND loc LIKE NVL(:3, loc) Step 3:-  The below picture shows the requirement so there fore we need to create a page to achieve the requirement. 35 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 two Submit 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 : 36 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 dno = null; String dname = null; String loc = null; //ManualsearchVOImpl vo= getManualsearchVO1(); OAViewObject vo= getManualsearchVO1(); if(pc.getParameter("item1")!=null) { dno = pc.getParameter("item1").toString(); vo.setWhereClauseParam(0,dno); } else { vo.setWhereClauseParam(0,null); } if(pc.getParameter("item2")!=null) { dname =pc.getParameter("item2").toString(); vo.setWhereClauseParam(1,dname); } else { vo.setWhereClauseParam(1,null); } if(pc.getParameter("item3")!=null) { loc = pc.getParameter("item3").toString(); vo.setWhereClauseParam(2,loc); } else { vo.setWhereClauseParam(2,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); ManualsearchAMImpl am=(ManualsearchAMImpl)pageContext.getApplicationModule(webBean); if(pageContext.getParameter("item4")!=null) { am.xxSearchParams(pageContext,webBean); } if(pageContext.getParameter("item6")!=null) { OAMessageTextInputBean msb = (OAMessageTextInputBean)webBean.findChildRecursive("item1"); msb.setValue(pageContext,null); OAMessageTextInputBean msb2 = (OAMessageTextInputBean)webBean.findChildRecursive("item2"); msb2.setValue(pageContext,null); OAMessageTextInputBean msb3 = (OAMessageTextInputBean)webBean.findChildRecursive("item3"); msb3.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: 37   Give some text in any Text input field and click on go button. 38 Check out our Popular Trainings  Structure of OAF Advantages and Dis-Advantages of OAF Oracle RAC DBA Training in Bangalore Creating First OAF Page in Project
About Author
Authorlogo
Name

TekSlate

Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills .