43
Views
2
Comments
Pagination of list inside Pagination of list
Question
Application Type
Reactive

I have a screen with a list of questions and each question has a list of answers.

The list of questions is paginated, e.g. 5 questions per page.

However, I also want the list of answers of each question to be paginated, e.g. 5 answers per page per question.

All data comes from a data action so I am following Kilian Hekhuis guide to implement pagination: https://itnext.io/paginating-sorting-and-filtering-data-from-a-data-action-f5cb997fdc60.

The output of my data action is a list of structure (StrQuestionAndAnswerList) with several variables: title of question, type of question, (...) and a list of structure with the answers for that question (strAnswer).

Then, in my main screen I have a List widget with StrQuestionAndAnswerList as a source. The pagination for that is working fine, meaning that I always have 5 questions per page.

Then, inside that list widget, I have another list widget with StrQuestionAndAnswerList.Current.strAnswer.

However, I cannot get the pagination right for this list of answers.


Can someone guide me on how to do this?

2023-02-22 12-00-34
Mukesh Nandeda

HI, To implement pagination on Answer list for a particular question you can use same pagination widget on the Answer list. Keep in mind that

TotalCount =AnsTotalCount(Total number of Answer of partiture question)

 StartIndex = AnsStartIndex (0)

MaxRecord  =AnsMaxRecord (5) 

And  OnNavigation handler you can increment AnsStartIndex by 5 and refresh DataAction/Aggregate.



UserImage.jpg
Cute Bear

Hi @Mukesh Nandeda

I am not able to do what you mean. 

Can you take a look at my .oml please?

https://personal-qrlqx9g4.outsystemscloud.com/Tests/DoublePagination

I am not able to edit the question anymore in order to put the .oml file and the demo app there.

I followed @Kilian Hekhuis 's guide on how to paginate a list coming from a Data Action.

The pagination of the questions per page seems fine, is the pagination of the answers per question that I cannot get right.

Tests.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.