7 Replies Latest reply: Jun 14, 2013 3:17 PM by Rudoph Wang RSS

    How to refresh the page navigate from

    Rudoph Wang
      Hi,
      I am working on multipages OAF application. I want to refresh the page navigated from. That is, I started with page A, from query up line click button to navigate Page B. After manipulating data in Page B, (Click button back to Page A) I want to refresh the record so my update/insert in page b reflects in Page A.
      Any idea/sample/suggestion will be appreciated in advance.
      Thanks.
      Rudy
        • 1. Re: How to refresh the page navigate from
          keerthioaf
          Hi Rudy ,

          If your page A is query only page then , attach a controller class to page A and in processRequest of the controller call a method
          defined in AMImpl.java which will execute a query .

          get the vo instance and execute the query , that will pull the updated record from data base . Use submit button in PAGE B to navigate back
          to page A .

          Let me know if its not clear .

          --Keerthi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
          • 2. Re: How to refresh the page navigate from
            Sandeep M.
            Hi Rudoph,

            If the page A and page B are using same VO instance then page A will display updated data if you retain the AM.

            If both the pages are using different VO or VO instance then you will have to re-query in page A controller after confirming that you are returning from page B.
            • 3. Re: How to refresh the page navigate from
              Rudoph Wang

              Hi, Sandeep

              Thanks for the response. I can partially refresh the page A. Which means page A is a searchable page, I open it up and put a string in Employee Name field, e. g. string "cri" and click Go and return 15 records. I click one of them to enter page B. After save in Page B, it is back to page A and the records are requeried. 15 records. in my program I only put person Id to query and intend to return only one record. Is there any way that I clean up page A and execute query?

              Thanks.

              • 4. Re: How to refresh the page navigate from
                Sandeep M.

                Hi,

                 

                In your case it seems you are using different VO instance for page A and page B.

                You just need to execute the query for the updated record person Id in page A VO.

                 

                In page A controller check that you are coming from page B after updating.

                  

                String fromPage = (String)pageContext.getSessionValue("FromPage");

                // you can set above value in page B using putSessionValue API

                  //    pageContext.removeSessionValue("FromPage");

                    //  pageContext.putSessionValue("FromPage", "PageB");

                 

                    if ("PageB".equals(fromPage))

                {

                execute page A view object with the updated record person Id

                // person Id can be passed as page parameter or can be put in session like above.

                }

                • 5. Re: How to refresh the page navigate from
                  Rudoph Wang

                  Thanks for suggestion.

                  This is what I do in page B controller processFormRequest

                         pageContext.removeSessionValue("EmpName");

                         pageContext.removeSessionValue("EmployeeNumber");

                         

                         TransactionUnitHelper.startTransactionUnit(pageContext, "refreshOverview");

                         String perId = pageContext.getParameter("personId");

                         pageContext.forwardImmediately("OA.jsp?page=/xxxxx/oracle/apps/xxxx/order/webui/OrderOverviewPG&newPersonId="+perId

                                                        , null

                                                        , OAWebBeanConstants.KEEP_MENU_CONTEXT

                                                        , null

                                                        , null

                                                        , false

                                                        , OAWebBeanConstants.ADD_BREAD_CRUMB_YES);

                   

                  in page A:

                      

                           String personId = pageContext.getParameter("newPersonId");
                          
                           // Initiate the query for the single person order record
                           Serializable[] parameters = { personId };
                           am.invokeMethod("requeryOverview", parameters);

                          

                           TransactionUnitHelper.endTransactionUnit(pageContext, "refreshOverview");
                       }

                   

                  Somehow the string I queried in Employee Name is still there and query back 15 records.

                  Something i did incurrect?

                  Thanks

                  • 6. Re: How to refresh the page navigate from
                    ViswanathChandran

                    Please check if your VO is executed after returning to PageA. 

                     

                    Probably you might have a if condition like (!isExecuted()) etc. Remove any if before executing the query.

                     

                     

                    Thanks,

                    Viswanath

                    • 7. Re: How to refresh the page navigate from
                      Rudoph Wang

                      VO does executed after returning to Page A. I need to return only one record, which I navigate away from Page A, and did update in Page B.