[OutSystems UI] Pagination works when I navigate to page 2, 3, 4 etc. but does not navigate back to 1
outsystems-ui
Reactive icon
Forge component by Platform Maintenance

Hi everybody,

I created a web block displaying the invoices of a company in a list. The list works well, the items are displayed properly and link to the invoice detail screen accordingly. At first glance, the pagination appears to work properly too: I can navigate from page 1 of the list to another page without any problem. However, I cannot navigate back to page 1 or use the "Previous" option. (Even though they appear to be enabled.)

Has anyone had this problem before? I specified the local variables StartIndex and MaxRecords properly; the event handler PaginationOnNavigate specifies the NewStartIndex input parameter, and contains an assign [StartIndex = NewStartIndex] and refreshes the aggregate GetInvoicesByCompanyId. Nonetheless, I can only navigate to pages with a higher number.

13.01.2023 Screenshot 3.png

Hello ,

Have you provided local variable startindex to GetInvoicesByCompanyId  aggregate startindex property??

Regards,

Swapnil Powar

Hi Swapnil, thank you for replying.

Yes, I had already done that.


Hi @Lotte1994 ,

i would take a look at filter and sorting of the aggregate, and if nothing stands out there, just debug what happens when you click back or 1 in navigation widget, and inspect all your variables during the OnPaginationNavigation action flow, that will be the quickest way to discover what's wrong.

Dorine

Hi Dorine, thank you for responding. I have tried debugging, but it's not possible for me, since I cannot click the "Previous" or "1" button (They are disabled.)

Hello,

Ok then check once default values for your local variables StartIndex, MaxRecords if you already set

Also check value for input parameter NewStartIndex of PaginationOnNavigate

Regards,

Swapnil Powar

Hi Swapnil, the default value for StartIndex is null, and the default value for MaxRecords is 5. I've done some debugging while navigating from 1 to 2, and the monitor clearly shows that StartIndex is set to 5 accordingly with NewStartIndex.

Hi  Lotte1994,

Which field are you using to sort?

I had in a past an issue in the navigation relative to the field used to sort which could cause some problems if field has repeated records.

solution was to sort by id which is unique

Hope that it help you




Hi Alexandre,

Thanks for responding. I added a sorting by ID, but the pagination still doesn't function properly:


mvp_badge
MVP
Solution

That is really weird. I'll ask OutSystems if they have a clue...

Solution

Hi @Lotte1994 

Can you please share a sample oml with that use case being replicated?

Cheers,
GM

Hi Goncalo,

Thank you for your response. There may be no need for this, since I've come closer to figuring out where the problem lies. When I add the CSS code (in the .txt file) to the block's style-sheet, the pagination doesn't work. (See attachment.)

I need this CSS code in order to make the pop-over menu in the list-item work. When I use it, the pop-over menu works, but the pagination doesn't work properly. When I remove this CSS code, the pagination works, but the pop-over menu doesn't.

19.01.2023.txt

Hi Goncalo,

I have solved the issue. Thank you for replying anyhow!

Hi @Lotte1994 

Thank you for the update and I'm glad to know you were able to fix it on your end.

Cheers,
GM

Hello ,

Have you provided local variable startindex to GetInvoicesByCompanyId  aggregate startindex property??

Regards,

Swapnil Powar

Hi Swapnil, thank you for replying.

Yes, I had already done that.


Hi @Lotte1994 ,

i would take a look at filter and sorting of the aggregate, and if nothing stands out there, just debug what happens when you click back or 1 in navigation widget, and inspect all your variables during the OnPaginationNavigation action flow, that will be the quickest way to discover what's wrong.

Dorine

Hi Dorine, thank you for responding. I have tried debugging, but it's not possible for me, since I cannot click the "Previous" or "1" button (They are disabled.)

Hello,

Ok then check once default values for your local variables StartIndex, MaxRecords if you already set

Also check value for input parameter NewStartIndex of PaginationOnNavigate

Regards,

Swapnil Powar

Hi Swapnil, the default value for StartIndex is null, and the default value for MaxRecords is 5. I've done some debugging while navigating from 1 to 2, and the monitor clearly shows that StartIndex is set to 5 accordingly with NewStartIndex.

mvp_badge
MVP

Hi Lotte,

Just a quick question: can you navigate to yet another page after the initial navigation from page 1 to another page? So e.g. 1 -> 2, 2 -> 3? Or are you stuck after the first navigation?

Hi Kilian, thank you for responding.
I can navigate from 1 → 2 and 1 → 3 etc.
I can also navigate from 2 → 3 and 3 → 4 etc.
Also, I can navigate from 4 → 3 and 3 → 2 and 4 → 2 etc.
However, I cannot navigate from any number back to 1.

I also noticed that I cannot navigate to the last page!
This means I cannot navigate to the first and last page of the list.
It's really strange.

mvp_badge
MVP
Solution

That is really weird. I'll ask OutSystems if they have a clue...

Hi  Lotte1994,

Which field are you using to sort?

I had in a past an issue in the navigation relative to the field used to sort which could cause some problems if field has repeated records.

solution was to sort by id which is unique

Hope that it help you




Hi Alexandre,

Thanks for responding. I added a sorting by ID, but the pagination still doesn't function properly:


Solution

Hi @Lotte1994 

Can you please share a sample oml with that use case being replicated?

Cheers,
GM

Hi Goncalo,

Thank you for your response. There may be no need for this, since I've come closer to figuring out where the problem lies. When I add the CSS code (in the .txt file) to the block's style-sheet, the pagination doesn't work. (See attachment.)

I need this CSS code in order to make the pop-over menu in the list-item work. When I use it, the pop-over menu works, but the pagination doesn't work properly. When I remove this CSS code, the pagination works, but the pop-over menu doesn't.

19.01.2023.txt

Hi Goncalo,

I have solved the issue. Thank you for replying anyhow!

Hi @Lotte1994 

Thank you for the update and I'm glad to know you were able to fix it on your end.

Cheers,
GM

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