8 Replies Latest reply: Nov 14, 2012 6:04 AM by Gyan Darpan RSS

    Not getting a handle to Seeded VO from custom region controller

    972542
      Hi Freinds,

      I am embedding a custom region to a seeded page by personalization.
      I have an AM and VO for custom region.

      When i am trying to call a seeded VO from my custom region controller i am not able to get a handle to it properly.

      I tried to get rootAm and then i called seeded VO. Some times i will get control but not able to create a rowsetiterator for that VO.

      OAApplicationModule rootAm=pageContext.getRootApplicationModule();
      oracle.jbo.ViewObject spupdateVo=rootAm.findViewObject("SpecialInformationUpdateVO1");
      RowSetIterator tblvorow= tblVo.findRowSetIterator("sptblVoRow");

      it is erroring at line 3.

      please help me to understand how to get a handle to seeded VO from custom region controller.
      My requirement is to loop through that seeded VO records.

      Thanks in advance..
      Jyothi
        • 1. Re: Not getting a handle to Seeded VO from custom region controller
          Jeet_A
          Hi,


          Below should work from Controller.
          import oracle.jbo.RowSetIterator;
          ...
          
              OAApplicationModule am = pageContext.getApplicationModule(webBean);
              oracle.jbo.ViewObject spupdateVo=am.findViewObject("SpecialInformationUpdateVO1");
              RowSetIterator tblvorow= spupdateVo.createRowSetIterator("sptblVoRow");
          Thanks,
          Jit

          Edited by: appsjit on Nov 10, 2012 9:24 PM

          Edited by: appsjit on Nov 12, 2012 7:59 AM
          • 2. Re: Not getting a handle to Seeded VO from custom region controller
            keerthioaf
            Hi Jyothi ,

            Could you please tell us what exactly is the error you are getting in line 3 , also ensure that your new nested region
            is inside the page layout and you have to attached VO to that .

            Keerthi

            Edited by: keerthioaf on Nov 11, 2012 10:27 AM
            • 3. Re: Not getting a handle to Seeded VO from custom region controller
              Gyan Darpan
              Hi,

              To create a row set iterator, use below line of code instead of your line number 3.
              OAApplicationModule rootAm=pageContext.getRootApplicationModule();
              oracle.jbo.ViewObject spupdateVo=rootAm.findViewObject("SpecialInformationUpdateVO1");
              
              RowSetIterator iter = spupdateVo.createRowSetIterator("iter");
              iter.setRangeStart(0);
              iter.setRangeSize(spupdateVo.getFetchedRowCount)
              Regards.
              Gyan
              • 4. Re: Not getting a handle to Seeded VO from custom region controller
                972542
                Hi Gyan/Keerthi,

                Thanks for your replies.

                I tried these methods earlier but was not working.
                The problem i am facing is i am not able to create a RowSetIterator for VO.

                Gyan, i tried your code also, it is failing at the step RowSetIterator.

                Keerthi,

                The error i am getting is
                java.lang.NullPointerException
                     at who.oracle.apps.per.selfservice.specialinformation.webui.SitUpdateCoExt29.processFormRequest(SitUpdateCoExt29.java:97

                At erroring line 97 i am creating RowSetIterator.

                I attached the region by personalization with in the pagelayout only and i have attached custom AM also to this custom region.

                Thanks
                Jyothi
                • 5. Re: Not getting a handle to Seeded VO from custom region controller
                  Gyan Darpan
                  Jyothi,

                  It's throwing null pointer exception becoz you have attached the VO to the custom AM. And this custom AM is attached to the Custom Region.

                  But in the code you are trying to find the spupdateVo in Root AM.

                  Regards,
                  Gyan
                  • 6. Re: Not getting a handle to Seeded VO from custom region controller
                    972542
                    Hi Gyan,

                    Yes, that is wat happening now.

                    So you are saying it is not possible to call seeded AM to custom region CO.

                    Then i think i have to extend the seeded AM and add my VO right?

                    Pls give ur suggestions

                    Thanks
                    Jyothi
                    • 7. Re: Not getting a handle to Seeded VO from custom region controller
                      Sushant Sharma
                      Hi,

                      I think you need to extend the controller at the pageLayout Region which would have access to all the regions and also their corresponding AMs.

                      --Sushant                                                                                                                                                                                                                                                                                                                                       
                      • 8. Re: Not getting a handle to Seeded VO from custom region controller
                        Gyan Darpan
                        Jyothi,

                        Its very much possible to get the handle of the custom AM from ur custom CO.

                        You need to change a line of code.

                        //Replace customGroupAM with the name of ur custom AM.
                        CustomGroupAM am = (CustomGroupAM)pageContext.getApplicationModule(webBean);

                        Regards,
                        Gyan