Calling one page to Another page in OAF


Calling one page to Another page in OAF


Now we are going to learn how to call one page from another page.

For this first we have to create one workspace and one project.

Next create one AM.

Create two pages one for data display and another for data entry.

Attach the AM to both the pages.

Now here I am not creating the pages once again I am using my previous data display and data entry page only.

Create the controller for each page.




Now when we click the create employee button it should redirect to data entry page.

For calling one page from another we have a method called pageContext.setForwardURL.

Write the following code in the processFormRequest of data display page controller( i.e in  the first  page controller.)




/*For Copy pasting the code */


 if(pageContext.getParameter("createEmployee")!=null)
{                    pageContext.setForwardURL("OA.jsp?page=/sangu/oracle/apps/po/DataDisplayPRJ/webui/DataInsertPG",
                                       null,
                                       OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                       null,
                                       null,
                                       true,
                                       OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
                                       OAWebBeanConstants.IGNORE_MESSAGES);
          }





"OA.jsp?page=/sangu/oracle/apps/po/DataDisplayPRJ/webui/DataInsertPG"

Complete path of the OAF page.

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.

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

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.

Null (parameter):- If we want to carry the values then we pass those values here.
True (Retain AM): generally this will be set to true value.

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

IGNORE_MESSAGES:- It will restrict the messages to not to carry from one page to another.


Run the page to see the output.



After clicking the Create Employee Button it will go to Data Entry page.




If u want go back to previous page then create one button in this page and write the code in this page controller.

12 comments:

  1. Hi,

    How to get this path, from which location we can find this
    OA.jsp?page=/sangu/oracle/apps/po/DataDisplayPRJ/webui/DataInsertPG
    Thanks
    pravin

    ReplyDelete
    Replies
    1. which page u have to created that page path we should get

      Delete
  2. Hi Praveen,

    This is the Syntax for page path.
    "OA.jsp?page= this part is the package with page name where your page is created"

    "OA.jsp?page=/sangu/oracle/apps/po/DataDisplayPRJ/webui/DataInsertPG"

    while creating page u will give the package right that package u have to give here
    else
    once run the page which u want to call and get this path from url.

    ReplyDelete
  3. Hi Sangu,

    i am getting the below error once i will press the button.

    Exception Details.
    oracle.apps.fnd.framework.OAException: No data found for region (/home/fhshaik/jdevhome/1213N_FS_NEW/myprojects/oracle/apps/qa/spc/webui/QADataStoreInsertPG). at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:536) at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3750) at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3472) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1107) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:543) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:431) at _OA._jspService(_OA.java:71) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)



    Please help me on this.......

    ReplyDelete
  4. Hi,

    While giving the path of page give the path as below

    OA.jsp?page=/oracle/apps/qa/spc/webui/QADataStoreInsertPG

    insted of this whole path
    /home/fhshaik/jdevhome/1213N_FS_NEW/myprojects/oracle/apps/qa/spc/webui/QADataStoreInsertPG

    Regards,
    Sangu

    ReplyDelete
  5. Hi,

    Thanks for sharing the information. I have created two small pages and I am trying to call the second page from the first using a button. Now when I click on the button, I encounter the stale data error. Is this because of the page creation or the calling of the second page. Please help with inputs.

    Regards,
    Hasan

    ReplyDelete
    Replies
    1. Hi Hasan,

      Once bounce the apache server and try. If not solved mail the screen shot of the error message.

      Regards,
      Sangu

      Delete
  6. This comment has been removed by the author.

    ReplyDelete
  7. thanks for information. Just wondering how to come back to original page and keep the old context alive.

    ReplyDelete
  8. Hi SSPatil,

    Which layout you use for Data Insertion Page.

    ReplyDelete
  9. hi
    can i get any tutorial for learn adf

    ReplyDelete
  10. Hi,
    I am trying to forward to a SIT page, since there is no PG.xml on the server(since special information),i am not sure how to do this???
    Can you help?

    ReplyDelete