Replace GetAggregate with a wrapper for table record

I have a new user requirement whereby the users want me to replace the GetPerson (tie to a PersonTable widget) with a wrapper.

I replaced it but the list navigation cannot work.

I found some other threads and post that aid me along the way, but whenever I clicked on any other pages (except page 1), it does not show any record found.

https://www.outsystems.com/forums/discussion/49027/get-page-number-from-list-navigation-widget/
https://www.outsystems.com/forums/discussion/26608/how-to-set-list-navigation-start-index-dynamically/
https://www.outsystems.com/forums/discussion/37002/how-the-pagination-navigation-widget-works/
https://www.outsystems.com/forums/discussion/26516/list-navigation/

This is what i did.

In my Person_GetForSearch wrapper, I have a GetPerson aggregate. The wrapper contains an output parameter Resultset that has a data type of Record with the two attributes: Count (Long Integer), and PersonSearchList (List of Person).


Start > GetPerson > Assign Resultset.PersonSearchList = GetPerson.List > Assign Resultset.Count = GetPerson.Count > End.


In UI, Set:

PersonTable's Source Record List = Resultset.PersonSearchList.

PersonTable's Start Index = List_Navigation_GetStartIndex(PersonTable.Id, True)


Then in the List_Navigation's Destination, i set to the following Server Action: RefreshPersonTable, where it contains:

Start > Person_GetForSearch > Assign Resultset.PersonSearchList = Person_GetForSearch.Resultset.PersonSearchList > Refresh PersonTable > Refresh Navigation > End.


What did i missed out that i cannot get any result to show up on page 2 and beyond?

Solution

Hi Newbie,


I'm intrigued.  I just created a small test oml, having both options on 1 screen, an aggregate inside screen action, and an aggregate in a called server action, and it works.


As far as I can tell, I did all the same steps as you, so maybe you can see what's different.  Maybe you have filters on your aggregate that interfere ?

See attachted oml


let me know what it was, I'm curious,

Dorine

Solution

I placed a breakpoint and it showed that there are returned result but the table is still blank.

Can you attach (example) oml

Dear Dorine

Thank you so much for your oml.

Finally, i figured out what went wrong.

It was the 'Max Record' that i set. I was trying to make Outsystems returned only the same amount of rows of data as the LineCount. Basically i was trying to get Outsystems to fetch only the necessary rows and not to fetch all the rows and then discard the unnecessary ones.

When i removed the Max Record setting, it all went well.

Ok, that makes sense.

I does only return the needed amount of rows, but it does have to first retrieve all rows up to the page you are at in the database.  See remark about that in this post under section Tips and Tricks