9 Replies Latest reply on Apr 6, 2016 11:32 PM by ORA_USER1122

    Get ScheduleLinesVORowImpl VO value from DetailsPageGlueCO Controller

    ORA_USER1122

      Hi Guru's,

      Was trying to get a value of view object in controller's processFormRequest.

      I need to do a validation on Receipt Amount of iExpense details page. If user enter over the limit of the policy schedule line, have to throw a custom error message with location rate, user entered rate and how much is the over the limit amount.

       

      I know there is client extension provided by oracle, but we want this to be achieved via controller extension, because this throws error message right away when user enters over the limit. user don't need to save explicitly to get the error message from client extension.

       

      Please provide some pointers on how to get the policy rate value from controller.

       

      Have tried like below, could anyone please tell how to get "Rate" of the policy schedule line.

       

      public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
            {
                if (paramOAPageContext.isLoggingEnabled(2)) {
                      paramOAPageContext.writeDiagnostics(this, "xxPR Start Of processFormRequest", 2);
                    }
                   
                super.processFormRequest(paramOAPageContext, paramOAWebBean);

                String str1 = paramOAPageContext.getParameter("event");
                String str2 = paramOAPageContext.getParameter("source");

                OAApplicationModuleImpl xxOAApplModImpl = (OAApplicationModuleImpl)paramOAPageContext.getRootApplicationModule();
               
                OAMessageTextInputBean xxRcpAmount = (OAMessageTextInputBean)paramOAWebBean.findChildRecursive("DetailReceiptAmount");
                //getting user entered amount.

                String xxReceiptAmount = (String)xxRcpAmount.getValue(paramOAPageContext);
                         
                ReceiptBasedLinesVORowImpl localReceiptBasedLinesVORowImpl = new ReceiptBasedLinesVORowImpl();
                ScheduleLinesVOImpl localScheduleLinesVOImpl = (ScheduleLinesVOImpl)xxOAApplModImpl.findViewObject("ScheduleLinesVO");
                ScheduleLinesVORowImpl localScheduleLinesVORowImpl = localScheduleLinesVOImpl.getPolicyScheduleLine(localReceiptBasedLinesVORowImpl);
                double xxRate = localScheduleLinesVORowImpl.getRate().doubleValue();


                //Tried this also, it throwing null value error xxRate1 is null.                 
                /*
                String rowReference = paramOAPageContext.getParameter(EVENT_SOURCE_ROW_REFERENCE);
                OARow currRow = (OARow)xxOAApplModImpl.findRowByRef(rowReference);
                String xxRate1 = (String)currRow.getAttribute("Rate");
                */
               
                if (paramOAPageContext.isLoggingEnabled(2)) {
                      paramOAPageContext.writeDiagnostics(this, "xxPR print xxReceiptAmount "+xxReceiptAmount, 2);
                        paramOAPageContext.writeDiagnostics(this, "xxPR print location rate "+xxRate, 2);
                    }
                   

      Thanks in advance..

        • 1. Re: Get ScheduleLinesVORowImpl VO value from DetailsPageGlueCO Controller
          ORA_USER1122

          Am getting this error per above code.

           

          Error Page

          Exception Details.

          oracle.apps.fnd.framework.OAException: oracle.jbo.DeadViewRowAccessException: JBO-27102: Attempt to access dead view row of persistent id 0

              at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1247)

              at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1435)

              at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:3001)

              at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1885)

              at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:550)

              at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:438)

              at _OA._jspService(_OA.java:212)

              at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)

              at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:390)

              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)

              at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)

              at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)

              at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)

              at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:388)

              at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:642)

              at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)

              at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)

              at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)

              at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)

              at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)

              at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)

              at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)

              at java.lang.Thread.run(Thread.java:662)

          ## Detail 0 ##

          oracle.apps.fnd.framework.OAException: oracle.jbo.DeadViewRowAccessException: JBO-27102: Attempt to access dead view row of persistent id 0

              at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:912)

              at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1169)

              at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1435)

              at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:3001)

              at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1885)

              at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:550)

              at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:438)

              at _OA._jspService(_OA.java:212)

              at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)

              at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:390)

              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)

              at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)

              at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)

              at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)

              at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:388)

              at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:642)

              at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)

              at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)

              at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)

              at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)

              at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)

              at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)

              at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)

              at java.lang.Thread.run(Thread.java:662)

          • 2. Re: Get ScheduleLinesVORowImpl VO value from DetailsPageGlueCO Controller
            aJohny

            Can you attach a screenshot of the Page and the path of PageXML ?

             

            You need to find the AM in which the VO belongs and get the VO from that AM using am.findViewObject.

             

            then use vo.getCurrentRow to get the row.

             

            then row.getAttribute() to get the Attribute value.

             

            Cheers

            AJ

            • 3. Re: Get ScheduleLinesVORowImpl VO value from DetailsPageGlueCO Controller
              ORA_USER1122

              Hi AJ,

               

              Am trying to get a location rate on details page for receipt based line details page. Please let me know where am doing wrong.

               

              Here it is XML file of DetailsPG.

               

              <?xml version="1.0" encoding="UTF-8"?>
              <!-- dbdrv: exec java oracle/jrad/tools/xml/importer XMLImporter.class java &phase=dat+24 checkfile(115.0=120.0):~PROD:~PATH:~FILE &fullpath:~PROD:~PATH:~FILE -username &un_apps -password &pw_apps -dbconnection &jdbc_db_addr -userId "1" -rootPackage /oracle/apps/~PROD -rootdir &fullpath:~PROD:mds:directory -->
              <page xmlns="http://xmlns.oracle.com/jrad" xmlns:jrad="http://xmlns.oracle.com/jrad" xmlns:oa="http://xmlns.oracle.com/oa" xmlns:ui="http://xmlns.oracle.com/uix/ui" xmlns:user="http://xmlns.oracle.com/jrad/user" version="9.0.3.8.11_1183" xml:lang="en-US" file-version="$Header: DetailsPG.xml 120.0 2005/12/01 01:11:12 skoukunt noship $">
                
              <content>
                
              <oa:pageLayout id="DetailsPG" extends="/oracle/apps/ap/oie/common/lines/webui/DetailsPage.PageLayout" amDefName="oracle.apps.ap.oie.server.WebExpensesAM" controllerClass="oracle.apps.ap.oie.entry.lines.webui.DetailsPageGlueCO" />
                
              </content>
              </page>


              And ShcheduleLinesVO exists on ExpensesAM(this is extended with WebExpensesAM).Here is the image of SchedulesLinesVO that attached as "ExpensesAM.JPG"

              ExpensesAM.JPG

              --- Controller Code Written as

                  public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)

                    {

                        if (paramOAPageContext.isLoggingEnabled(2)) {

                              paramOAPageContext.writeDiagnostics(this, "xxPR Start Of processFormRequest", 2);

                            }

                           

                        super.processFormRequest(paramOAPageContext, paramOAWebBean);

               

                        String str1 = paramOAPageContext.getParameter("event");

                        String str2 = paramOAPageContext.getParameter("source");

               

               

                        OAApplicationModuleImpl xxRootAM = (OAApplicationModuleImpl)paramOAPageContext.getRootApplicationModule();

                        OAApplicationModuleImpl xxExpAM = (OAApplicationModuleImpl)xxRootAM.findApplicationModule("ExpensesAM");

                        OAViewObject xxSchLinesVO = (OAViewObject)xxExpAM.findViewObject("ScheduleLinesVO");// 106 Line, why it's not returning data don't know.

               

                        ScheduleLinesVORowImpl xxSchLinesVORow = null;

                       

                        if (xxSchLinesVO!=null)

                                     {

                                        xxSchLinesVORow=(ScheduleLinesVORowImpl)xxSchLinesVO.getCurrentRow();  

                                        if (xxSchLinesVORow!=null) {

                                              String xxRate = (String)xxSchLinesVORow.getAttribute("Rate");

                                             

                                            if (paramOAPageContext.isLoggingEnabled(2)) {

                                                  paramOAPageContext.writeDiagnostics(this, "xxPR print xxReceiptAmount "+xxReceiptAmount, 2);

                                                    paramOAPageContext.writeDiagnostics(this, "xxPR print location rate "+xxRate, 2);

                                                }

                                        }

                                       

                                     }

              }

               

              Running into error again please see below.

              Exception Details. 

              oracle.apps.fnd.framework.OAException: java.lang.NullPointerException

                at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:912)

                at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1169)

                at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1435)

                at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:3001)

                at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1885)

                at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:550)

                at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:438)

                at _OA._jspService(_OA.java:212)

                at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)

                at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:390)

                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)

                at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)

                at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)

                at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)

                at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:388)

                at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:642)

                at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)

                at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)

                at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)

                at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)

                at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)

                at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)

                at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)

                at java.lang.Thread.run(Thread.java:662)## Detail 0 ##

              java.lang.NullPointerException

                at proiedtlspg.oracle.apps.ap.oie.entry.lines.webui.xxDetailsPageGlueCOEx.processFormRequest(xxDetailsPageGlueCOEx.java:106)

                at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:827)

                at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:385)

                at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1206)

                at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)

                at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1039)

                at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1005)

                at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:860)

                at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:385)

                at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)

               

              Thanks always..

               

               

              • 4. Re: Get ScheduleLinesVORowImpl VO value from DetailsPageGlueCO Controller
                Shddn
                     

                ScheduleLinesVORowImpl localScheduleLinesVORowImpl = localScheduleLinesVOImpl.getPolicyScheduleLine(localReceiptBasedLinesVORowImpl);

                 

                what are you trying to do here ?

                • 5. Re: Get ScheduleLinesVORowImpl VO value from DetailsPageGlueCO Controller
                  ORA_USER1122

                  Hi Shddn,

                   

                  Am trying to get policy schedule line location rate. So there is a method in ScheduleLinesVOImpl which require a parameter. sorry for any mistake, am beginner in this coding

                   

                  Please let me know if it's possible to get location rate from above page DetailsPageGlueCO controller

                   

                  public ScheduleLinesVORowImpl getPolicyScheduleLine(ExpenseReportLinesVORowImpl paramExpenseReportLinesVORowImpl)

                    {

                  ............

                  }

                  Thanks..

                  • 6. Re: Get ScheduleLinesVORowImpl VO value from DetailsPageGlueCO Controller
                    aJohny

                    What is line no :106   xxDetailsPageGlueCOEx.java ?

                     

                    Try to get the region handle and get the AM from that and then get the VO from that.

                     

                    Cheers

                    AJ

                    • 7. Re: Get ScheduleLinesVORowImpl VO value from DetailsPageGlueCO Controller
                      ORA_USER1122

                      Thanks always AJ, I think it's better get the seeded method which is used for validation and then get custom message.

                      I don't see if it's possible to do that from controller?

                      OR

                      Can we extend the seeded VORowImpl methods?

                       

                      Which is the best way?

                      • 8. Re: Get ScheduleLinesVORowImpl VO value from DetailsPageGlueCO Controller
                        CaptiveCode

                        Hi ORA_USER1122,

                         

                        In your original question, I notice that you are attempting to access values using webBeans. This is not considered to be the best practice. To access values on a page, always get a handle to the AM ==> access the VO using the AM ==> Read the value from the view attribute.


                        Based on your description of your issue and the information you have shared so far, I would recommend you to do the following:

                        1. Find the view object instance name of the fields Receipt Amount & Schedule Limit by clicking About This Page link at the bottom of the page

                                  OAViewObject xxSchLinesVO = (OAViewObject)xxExpAM.findViewObject("ScheduleLinesVO");// 106 Line, why it's not returning data don't know.

                                  Solution: This may not be returning a row because the view object instance name may be ScheduleLinesVO1 and not ScheduleLinesVO. Validate this by printing the page XML


                        2. Identify the AM's to which your VOs are belong

                                  Question: Are both the VOs (ScheduleLinesVO and ReceiptLinesVO) are within Expense AM?

                         

                        3. Get the handle to the AM in the controller

                        4. Get the handle to view objects using the AM

                                 ScheduleLinesVORowImpl scheduleVO = ExpenseAM.findViewObject("<View Instance Name>")

                                 ExpenseReportLinesVORowImpl reportLineVO = ExpenseAM.findViewObject("<View Instance Name>")


                        5. Get the receipt amount from the View Attribute:

                                             Tip: This is not best practice, get it from the VO: reportLineVO.getAttribute("<AttrName>")

                                            String xxReceiptAmount = (String)xxRcpAmount.getValue(paramOAPageContext);


                        6. Use the seeded method to fetch the schedule lines. This should work. Did you review the content of this method? What does it do?

                        public ScheduleLinesVORowImpl getPolicyScheduleLine(ExpenseReportLinesVORowImpl paramExpenseReportLinesVORowImpl) {............}

                         

                         

                        7. Perform desired validation.



                        • 9. Re: Get ScheduleLinesVORowImpl VO value from DetailsPageGlueCO Controller
                          ORA_USER1122

                          Thanks for the reply Captivecode,

                          will look into it and get back to you.