35
Views
14
Comments
Solved
OnPaginationNavigate does not work when there is buttongroup for active,inactive, all
Question

Hi all,
I have a buttongroup which filters list of projects epending on active, inactive, all. The button group works fine but the pagination does not work. 


2021-04-09 11-42-43
assif_tiger
 
MVP
Solution


Action:


ButtonGrp : Passing hard-coded 0


Navigation\Pagination : Passing Event Param





 
2021-04-09 11-42-43
assif_tiger
 
MVP

Hi,
Please share the Action reference attached to paginaion.
Addtionally make sure you're refreshing the source aggregate under the same.

If possible share the sample OML.

Ref:
https://success.outsystems.com/documentation/11/building_apps/user_interface/patterns/using_mobile_and_reactive_patterns/navigation/pagination/


Good Luck

UserImage.jpg
Siaming Ming

Hi @assif_tiger

My aggregate bound to the table has a filter and has a max record of 10:

On ButtonGroupOnchange, I refresh the GetProjects which has the filter from the image above: 
Then for my pagination, I also refresh the GetProjects.

The problem is the pagination does not work:

2021-04-09 11-42-43
assif_tiger
 
MVP

Please find the attached POC sample
- I added a table , sort , pagination & buttongrp
- Used OS-SampleDB Table
- Ref same action for both ButtonGrp Onchange & Pagination
- Note: I am passing 0 as NewStartIndex from ButtonGrp to reset the pagination when filtering source by ButtonGrp
- My max recod is set to 5 for better understanding the pagination & filter

Demo:
https://assif.outsystemscloud.com/pagipoc/


OML Attached
_ Good Luck

pagipoc.oml
UserImage.jpg
Siaming Ming

Hi @assif_tiger
Our code looks exactly the same however my pagination still shows 11 to 11 of 11 items.

2021-04-09 11-42-43
assif_tiger
 
MVP

Please confirm:

- You reset the StartIndex as 0

Please share OML

UserImage.jpg
Siaming Ming

Hi @assif_tiger
I can't share OML as it's in dev env. 

However, I tried reseting the StartIndex as 0

It worked in active projects but in ALL projects, it gets back to page1

2021-04-09 11-42-43
assif_tiger
 
MVP
Solution


Action:


ButtonGrp : Passing hard-coded 0


Navigation\Pagination : Passing Event Param





 
UserImage.jpg
Siaming Ming

Thanks @assif_tiger ,


Pagination:


Pagination action:

Our code looks really the same, yet I still can't fix it

2021-04-09 11-42-43
assif_tiger
 
MVP

Sorry this may sound funny but just confirm
- Value you declared on each buttongroup item
- Debug the ButtonGroup Change event & notice the IsActive_Filter value; as this one is responsible to bring the filtered data 
- Please confirm whether or not you have InActive records in table :)


2019-01-07 16-04-16
Siya
 
MVP

@Siaming Ming :  Your code looks good. I created a sample application on my end following your approach, and it works. Looking at your pagination screenshot, while you are on page 2, it should display only 1 record (11 to 11 of 11 items), but it shows 10 records instead. Do you have any other screen aggregates, and could any of them be incorrectly assigned to the table?
Also, please handle the 'On After Fetch' event of your aggregate and attach a debugger to see what might be going wrong.

UserImage.jpg
Siaming Ming

Hi @Siya
I only use one aggregate for the table but it still shows 11 to 11 of 11 items. I have checked the aggregates and it should work fine but still went wrong

2025-04-14 11-22-14
Aditi Saraswat

Hi @Siaming Ming,

If possible, could you please share the OML file?
It would help in resolving your issue more effectively. 

Thanks

UserImage.jpg
Siaming Ming

Hi @Aditi Saraswat
Thank you for your response. I can't share OML file as this is in dev env.
However when trying to reassign 0 as startIndex, it works in active filtered projects but not in All projects. It simply go back to page 1

2025-04-14 11-22-14
Aditi Saraswat

Assign the value of NewStartIndex to the StartIndex local variable, which is used to fetch data from the aggregate, and pass the NewStartIndex value to the OnPaginationNavigate action. 

When the "All Projects" button group is clicked, pass 0 as the value for NewStartIndex. 

Hope this helps.

Thanks

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