4 Replies Latest reply: Sep 7, 2013 2:21 AM by Niladri Saha RSS

    Issue with VO iteration

    Niladri Saha

      Hi,

       

      I have a auto customization search page. I have used a VO in table region.

      after search it returns 3 or 5 rows. but in controler i am getting more than 2500 rows. not able to iterate the vo.

      the code is below.

       

      if (pageContext.getParameter("saveBG") != null)

          {

              System.out.println("inside save :");

             OAApplicationModule am = pageContext.getApplicationModule(webBean);

             OAViewObject vo = (OAViewObject)am.findViewObject("FTLItemSummaryVO");

              pageContext.writeDiagnostics(this,"inside submitt " ,4);

             //

             Row row;

             int qty = 0;

             String v_item_no = new String();

             String v_uom = new String();

             //

             //long totalRows = vo.getEstimatedRowCount();

             //int currentRow = vo.getCurrentRowIndex();

              vo.setRangeSize(-1);

             Row[] allRows = vo.getAllRowsInRange();

             // pageContext.writeDiagnostics(this,"inside submitt totalRows"+totalRows ,4);

             // pageContext.writeDiagnostics(this,"inside submitt currentRow"+currentRow ,4);

             //

             int lngth=allRows.length;

              System.out.println("inside save lngth:"+lngth);

      IT prints 2700 rows.

       

       

       

      if i dont use setRangeSize(-1), I am getting only one row.

       

      Not able to get the correct number of roes as showing into the table.

       

      Thanks,

      Niladri

        • 1. Re: Issue with VO iteration
          Siva Prasad Nidimamidi

          Hi,

           

          I don't understand your problem. Can you please elaborate it clearly?

           

          Before that

          Test One:

          ==> Execute the query in SQLdeveloper or TOAD, See how many rows its returning.

          ==> Now make a conclusion that if same number of rows returning in controller then its OK else you will have to check.

          Test Two:

          ==> are you adding where clause dynamically?

           

          let me know in case of any issue. You can contact me siva432@gmail.com

          • 2. Re: Issue with VO iteration
            DilipG

            Hi Niladri,

             

              You can replace your code with below code. It will work.

             

            if (pageContext.getParameter("saveBG") != null)

            {

            System.out.println("inside save :");

            OAApplicationModule am = pageContext.getApplicationModule(webBean);

            FTLItemSummaryVOImpl svo = getFTLItemSummaryVO1();

            for(Row row=svo.first();row!=null;row=svo.next())

            {

            FTLItemSummaryVORowImpl rowi = (FTLItemSummaryRowImpl)row;

             

            // Do  get set attribute here

            }

            }

             

            Thanks,

            Dilip

            • 3. Re: Issue with VO iteration
              Niladri Saha

              Hi,

               

              Thanks for replying.

               

              The query which is there in VO is returning more than 2500 rows. But by clicking go in autocustomaizatio page.

              Vo returns 3 rows which i can see into the result table. but when clicking submit button, in controler I want to get only those 3 rows which are there in my page.

              But I am getting all the 2500 rows. I have used vo.getQuery() in submit loop in controler which returns the original VO query,

              But My question is after search VO query should have been changed. I should get the modified filter query.

               

               

              I have done VO.next() also which also looping for 2500 times.

              • 4. Re: Issue with VO iteration
                Niladri Saha

                Hi,

                 

                Pls let me know, How to handle the VO after autocustomization search??

                after the search, I am not getting the executed vo rows. Its returning 0 rows.