• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Creating Search Page

In this lesson we are going to see how to create the Search page according to the document.

According to the MD-050 document we need to create Manual Search Page. So let us see how to crate a Manual search page step wise:

  1. Create One new page on the project.
  2. Attach AM to the project.
  3. Design the page structure.

 

For example:

 

Page Name: SearchPG

Attached AM Name: xxstirling.oracle.apps.po.stirlingprj.webui

 

The below figure shows the page structure of the Search Page, which contains 3 message Text Input items for searching and down one table layout region.

 

Here the search result will be displayed in table format so here we are adding images for update and detail of the resultant rows in OAF page. The below picture shows the page structure of the search page:

44

The below figure shows the page structure output of the Search Page:

45

Still now we just created the page structure but the page is not yet validated properly.

 

After creating page structure we need to create the Method in AM for search operation, it means if we are entering patient Id then in the where condition SQL Query must filter the Rows according to the entered Patient Id related similarly for Patient Name and Patient Phone Number too.

So therefore we need to write a SQL data retrieval Query, create one VO and write the Query in the VO Qeury area:

 

VO Name: SearchVO

 

Package Name: xxstirling.oracle.apps.po.stirlingprj.server

 

Write the Following Query in the query region of VO:

SELECT * FROM XXSTIRLING_PATIENT_ENTRY_TABLE

WHERE PATIENT_ID LIKE NVL(:1, PATIENT_ID)

AND PATIENT_NAME LIKE NVL(:2, PATIENT_NAME)

AND PHONE_NUMBER LIKE NVL(:3, PHONE_NUMBER)

 

After Creating VO attach VO to the AM. After attaching create method in AM, the following code shows the java code of creating Method in AM.

 

public void xxSearchPatient (OAPageContext pc, OAWebBean wb)

{

String pid = null;

String name = null;

String phno = null;

SearchVOImpl vo1= getSearchVO1();

if (pc.getParameter(“item1”)!=null)

{

pid = pc.getParameter(“item1”).toString();

vo1.setWhereClauseParam(0,pid);

}

else

{

vo1.setWhereClauseParam(0,null);

}

if(pc.getParameter(“item2”)!=null)

{

name = pc.getParameter(“item2”).toString();

vo1.setWhereClauseParam(1,name);

}

else

{

vo1.setWhereClauseParam(1,null);

}

if(pc.getParameter(“item3”)!=null)

{

phno = pc.getParameter(“item3”).toString();

vo1.setWhereClauseParam(2,phno);

}

else

{

vo1.setWhereClauseParam(2,null);

}

vo1.executeQuery();

}

Create One controller in Search page and initialize the AM in the SearchPage  Controller, note that we already initialized AM in Patient Entry page Controller. Now we are initializing AM in SearchPage Controller, initialize the AM in ProcessRequest as follows:

 

StirlingAMImpl am= (StirlingAMImpl)pageContext.getApplicationModule(webBean);

 

According to the page output we need to validate three buttons:

  1. Search Button
  2. Clear Button
  3. Add New Patient.

Search Button, Clear Button, and Add New Patient buttons Validation code in Process Form Request is as follows:

StirlingAMImpl am= (StirlingAMImpl)pageContext.getApplicationModule(webBean);

if(pageContext.getParameter(“item4”)!=null)

{

am.xxSearchPatient(pageContext,webBean);

}

else

if(pageContext.getParameter(“item6”)!=null)

{

OAMessageTextInputBean mstb = (OAMessageTextInputBean)webBean.findChildRecursive(“item1”);

mstb.setValue(pageContext,null);

OAMessageTextInputBean mstb1 = (OAMessageTextInputBean)webBean.findChildRecursive(“item2”);

mstb1.setValue(pageContext,null);

OAMessageTextInputBean mstb2 = (OAMessageTextInputBean)webBean.findChildRecursive(“item3”);

mstb2.setValue(pageContext,null);

}

else

if(pageContext.getParameter(“item8”)!=null)

{

pageContext.setForwardURL(“OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StrilingPG”,

null,

OAWebBeanConstants.KEEP_MENU_CONTEXT,

null,

null,

true,

OAWebBeanConstants.ADD_BREAD_CRUMB_YES,

OAWebBeanConstants.IGNORE_MESSAGES);

}

 

Rebuild the code and run the page the below image shows the search page with results after clicking on Search Button:

 

46

If we observe in the output we created two image items one is for Update and Other is for Details of the patients. We not yet validated the Edit and Update images.

The next lesson shows how to create Update page and the page structure of the Update page and output of Update, but for Update the values must be carried so hence we know that to carry values we will create SPEL in OAF.

Summary
Review Date
Reviewed Item
Creating Search Page
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Creating Search Page"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.