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

Final Code in AM, Update Page, and Patient Entry Page

There are few changes we need to made while calling or navigating from one form to another form.

So after all the final code in the Update page controller class looks like the following:

 

public void processRequest(OAPageContext pageContext, OAWebBean webBean){  super.processRequest(pageContext, webBean);  StirlingAMImpl am = (StirlingAMImpl)pageContext.getApplicationModule(webBean);  //am.xxinsertpatient();  if(pageContext.getParameter(“pid”)!=null)  {   String pid = pageContext.getParameter(“pid”).toString();   String whereclause = “PATIENT_ID='”+pid+”‘”;   am.getPatientEntryVO1().setWhereClause(null);   am.getPatientEntryVO1().setWhereClause(whereclause);   am.getPatientEntryVO1().executeQuery();  }  else  {   am.xxinsertpatient();  } OAMessageRadioButtonBean var1 = (OAMessageRadioButtonBean)webBean.findChildRecursive(“male”); var1.setName(“Gender”); var1.setValue(“Male”); OAMessageRadioButtonBean var2 = (OAMessageRadioButtonBean)webBean.findChildRecursive(“female”); var2.setName(“Gender”); var2.setValue(“Female”);}/*** 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); StirlingAMImpl am= (StirlingAMImpl)pageContext.getApplicationModule(webBean); // am.xxinsertpatient(); if (pageContext.getParameter(“update”)!=null) {  am.getOADBTransaction().commit();  throw new OAException(“Patient Data Updated Successfully”,OAException.CONFIRMATION); } if(pageContext.getParameter(“item4”)!=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); }}

The above code is the Controller class code in Update Page.

 

Let us see the Patient Entry page controller code:

 

public void processRequest(OAPageContext pageContext, OAWebBean webBean){ super.processRequest(pageContext, webBean); StirlingAMImpl am = (StirlingAMImpl)pageContext.getApplicationModule(webBean); if(pageContext.getParameter(“ppatientid”)!=null) {  String pid = pageContext.getParameter(“ppatientid”).toString();  String whereclause = “PATIENT_ID='”+pid+”‘”;  am.getPatientEntryVO1().setWhereClause(null);  am.getPatientEntryVO1().setWhereClause(whereclause);  am.getPatientEntryVO1().executeQuery(); } else {  am.xxinsertpatient(); } OAMessageRadioButtonBean var1 = (OAMessageRadioButtonBean)webBean.findChildRecursive(“male”); var1.setName(“Gender”); var1.setValue(“Male”); OAMessageRadioButtonBean var2 = (OAMessageRadioButtonBean)webBean.findChildRecursive(“female”); var2.setName(“Gender”); var2.setValue(“Female”);}/*** 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); StirlingAMImpl am = (StirlingAMImpl)pageContext.getApplicationModule(webBean); if (pageContext.getParameter(“item3”)!=null) {  System.out.println(“Add button called”);  am.getOADBTransaction().commit();  throw new OAException(“Patient Data Entered Successfully”,OAException.CONFIRMATION); } if(pageContext.getParameter(“item9”)!=null) {  pageContext.setForwardURL(“OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/SearchPG”,                            null,                            OAWebBeanConstants.KEEP_MENU_CONTEXT,                            null,                            null,                            true,                            OAWebBeanConstants.ADD_BREAD_CRUMB_YES,                            OAWebBeanConstants.IGNORE_MESSAGES);  }  else  if (pageContext.getParameter(“item11”)!=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);  }}

 

The code below is the code is the AM Java code, and note that we created only one AM for the entire project. We created two methods overall in AM and the below code shows the two methods:

 

public void xxinsertpatient(){  PatientEntryVOImpl vo= getPatientEntryVO1();  OADBTransaction trans= getOADBTransaction();  vo.executeQuery();  Row v_row = (Row)vo.createRow();  vo.insertRow(v_row);}public void xxSearchPatient (OAPageContext pc, OAWebBean wb){  String pid = null;  String name = null;  String phno = null;  //OAViewObject vo= getSearchVO1();  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();}

 

Summary
Review Date
Reviewed Item
Final Code in AM, Update Page, and Patient Entry Page Controller
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 Final Code in AM, Update Page, and Patient Entry Page Controller"

    Leave a Message

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

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.

    Support


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.