Forum Stats

  • 3,851,368 Users
  • 2,263,966 Discussions
  • 7,904,689 Comments

Discussions

DCIteratorBinding getAllRowsInRange is not getting all rows

DLopez
DLopez Member Posts: 278
edited Feb 22, 2018 12:59AM in JDeveloper and ADF

Hi,

Using Jdev 12.2.1.2.

I have a jsff fragment with a table with records of Documents:

- first time some one access it it will show the current day documents;

- after that the user can change the filters to look for a specific document

At the bottom of the page I will show the totals of the documents (counters and other values).

To calculate those totals I will access the Iterator of that table and loop for each record, for that I use DCIteratorBinding getAllRowsInRange to obtain all rows returned from my WebService (REST).

The problem I'm having is:

- that the first time, getAllRowsInRange method returns me 1 row that is empty, so I only see zeros (problem) - I have 3 rows on the original response and the table presents them

- if I change the date filter and execute the service again, getAllRowsInRange will return me the correct amount of rows and will calculate the total amounts (all good)

- if I change the filter back to today's date, it will also work as it should be (all good)

I'm currently out of ideas. Can any one help?

Thanks

Daniel

Tagged:

Answers

  • PedroGabriel
    PedroGabriel Member Posts: 244 Bronze Badge
    edited Feb 21, 2018 12:13PM

    Hi Daniel,

    How are you filtering data the first time you get in your page?

    Are you managing it in your Task Flow? If so, did you drag-and-drop the ExecuteQuery operation there? Don't you have a wrong filter parameter over there?

    Best Regards,

    Pedro Gabriel

  • DLopez
    DLopez Member Posts: 278
    edited Feb 21, 2018 12:23PM

    Hi Pedro

    When I enter that page, the method on the bindings uses the current date, defined in a View Scope Bean and my service is not executed twice

  • PedroGabriel
    PedroGabriel Member Posts: 244 Bronze Badge
    edited Feb 21, 2018 12:27PM

    Hi,

    My big question here is if you are setting the right parameters the first time you enter in the page.

    Have you tried to set manually your own parameters just to check if isn't some value that is incorrectly used as input parameter?

    Are you using the same DCIteratorBinding before entering page and after being there performing your own filtering?

    Best Regards,

    Pedro Gabriel

  • DLopez
    DLopez Member Posts: 278
    edited Feb 21, 2018 12:40PM

    I will test with harcoded values to check.

    Yes, the Iteraror is the same

  • ManishPandey
    ManishPandey Member Posts: 1,722 Silver Trophy
    edited Feb 22, 2018 12:59AM

    Hi you can use getEstimatedRowCount to get total no rows.

                            DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("yourbinding");

                            long cnt=dciter.getEstimatedRowCount();

    if you want to get rows data then get view object instance from dciter

                            ViewObject vo=dciter.getViewObject();

                            Row row=null;

                            for(int i=0;i<cnt; i++)

                                             {

                                                 if(i==0)

                                                 {

                                                   row=  vo.first();

                                                     }

                                                 else

                                                 {

                                                   row=  vo.next();

                                                     }

                                                

                                                 }

This discussion has been closed.