Calling OAF Pages Using Update and Detail Image Icons

Ratings:
(4)
Views:738
Banner-Img
  • Share this blog:

In the search page, we have seen two images for every row result one is to Update the patient details with image icon, and another is for seeing the details, and the image icon is.

Now we need to validate the image items in the result, and whenever we click on these image items it must take us to another page along with carrying the values too, so therefore we need to create SPEL for each image item, and then we have to write the code in processFormRequest of search page controller.

SPEL value of Update icon: ${oa.SearchVO1.PatientId}

Parameter Name of Update Icon: pid

SPEL value of Detail Icon: ${oa.SearchVO1.PatientId}

Parameter Name of Detail icon: ppatientid

Write the following code in ProcessFormRequest of search page controller, continuing the previous code

..........................................}elseif("update".equals(pageContext.getParameter(EVENT_PARAM))){  pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StirlingUpdatePG",                             null,                             OAWebBeanConstants.KEEP_MENU_CONTEXT,                             null,                             null,                             true,                             OAWebBeanConstants.ADD_BREAD_CRUMB_YES,                             OAWebBeanConstants.IGNORE_MESSAGES);}elseif("detail".equals(pageContext.getParameter(EVENT_PARAM))){  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);}

Now the entire code in the controller class of Search page looks like the following:

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean){ super.processFormRequest(pageContext, webBean); 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);  }  else  if("update".equals(pageContext.getParameter(EVENT_PARAM)))  {   pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StirlingUpdatePG",                             null,                             OAWebBeanConstants.KEEP_MENU_CONTEXT,                             null,                             null,                             true,                             OAWebBeanConstants.ADD_BREAD_CRUMB_YES,                             OAWebBeanConstants.IGNORE_MESSAGES);  }  else  if("detail".equals(pageContext.getParameter(EVENT_PARAM)))  {   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);  }}

Calling One Form to Another Form

In this lesson, we will see how to call one page from the current page in OAF. To create a link between two pages we have “pageContext.serForwardURL”.

First, create WorkSpace and project.

Create AM, create a page and attach AM to the page.

Here we are creating VO which displays employee information which is entered using the previous chapter page.

We know that to display data we need to create VO, attach VO to AM, and then we need to execute the VO query whenever we click on the button, so therefore for that, we need to write the code in the Process Form Request of Controller.

To know how to display data from the database see the chapter called Displaying Data from DataBase.

Let us see  the parameter list in “pageContext.setForwardURL”.

example code is :

line1 :  pageContext.setForwardURL (DestinationPagePath,

line2: null,

line3 : menu_context,

line4 : null,

line5 : params(null),

line6 : RetainAM(true),

line7 : ADD_Bread_Crumbs,

line8 : Ignore_Messages);

In line1 :- Destination Page Path : Complete path of the OAF page.

line2:- null : If we want to call oracle apps form then in first line Destination page path is null, and here we will give the function name of the form. Line1 and Line2 are interlinked.

line3:- menu_context: We can include any number of menus as we require.

line4:- null: if we want only one particular menu then here we will specify that menu name, and in line3 we need to pass null, line3 and line4 are interlinked.

line5: -params(null) : If we want to carry the values then we pass those values here.

line6:- RetainAM(true): this will be set to true value.

line7: -Add_Bread_Crumbs: If we want the link to carry to next page and store in the memory.

line8:-Ignore Messages: It will restrict the messages to not to carry from one page to another.

In this chapter we used displaying data of employees information which are entered in Data Entry page of the previous lesson, if we want to see the employees information then we need to click on the button “Get Employee Information” and to create a new employee we need to click on “Create Employee” button.

The page structure of the Project what we are using now contains one main region and under it, One Table Using Wizard Region, two submit buttons. The following figure shows the page structure:

94

If we run the page after creating VO and executing that VO whenever we click on the “Get Employee Information” then the output looks like the following:

95

If we observe in the output whenever we click on the Create Employee button, it must take us to the Create Employee page which we created and seen in the previous lesson.

Whenever we click on the Create Employee button then only it must take us to the Create Employee page so for that we need to write the code in the “processFormRequest”  of controller and the code in processFormRequest is:

if(pageContext.getParameter("item3")!=null){  pageContext.setForwardURL("OA.jsp?page=/xxapples/oracle/apps/po/insertingrecords/webui/InsertDataPG",                            null,                            OAWebBeanConstants.KEEP_MENU_CONTEXT,                            null,                            null,                            true,                            OAWebBeanConstants.ADD_BREAD_CRUMB_YES,                            OAWebBeanConstants.IGNORE_MESSAGES);}

In the program “item3″ is the id value of the Create Employee button. When we rebuild the code and run the page then the output looks like the following:

96

Now after clicking on the Create Employee button, it leads us to Create Employee page:

97

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses

1/15

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 in the market.