116
Views
9
Comments
Solved
[OutSystems UI] Pagination not working when delete last item from the list
outsystems-ui
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Hi All,

I'm working on a scenario where I'm showing a pagination in a listing page and there is a delete action for every item.

When I delete the last item of any page the pagination will not work properly and will not load the pagination number and the content in a proper manner. 

It will happen only when I delete the last record of every page.

Please suggest me any idea for this. Find the image for the reference.

Thanks

Prince Kumar


paginationimage.jpg
2022-02-02 14-10-01
Brooks Slocum
Staff
Solution

Adding successful snippet of code in case anyone needs to implement similar functionality. Had to make one minor edit due to the aggregate refresh. Please refer to comments in the screenshot.


2023-12-14 09-56-57
Yogesh Javir
Solution

Hi Buddy,

You have to do some manual assign and condition on delete.
Use below If condition after delete
StartIndex<(GetDataById.Count/10)*10

and after that assign below on false
StartIndex-MaxRecords

This is working fine for me

Please mark solution if works

2026-04-23 05-29-20
Prince Kumar

Thanks @Yogesh Javir, for your reply. It works for me :) 

Thanks 

Prince

2019-12-06 08-26-53
Jorge Rodrigues

Hello Prince,

At the end of your delete action are you using the RefreshData from the listing?

Regards,

Jorge Rodrigues

2026-04-23 05-29-20
Prince Kumar

Thanks for the reply, Jorge

Yes, I'm refreshing the data from listing. Can see the image below

img2.PNG
2019-12-06 08-26-53
Jorge Rodrigues

Can you send the OML file for me to analyze?

2026-04-23 05-29-20
Prince Kumar
2020-11-13 07-48-15
Khuong Truong

Hi,

Please take a look at this sample, and .oml attached.

Cheers,

Khuong

ListDemo.oml
2026-04-23 05-29-20
Prince Kumar

Thanks for the reply Khuong, 

But this functionality already done in the application on page navigate. 

This will work while navigating the page only when we click on the pagination. 

But my issue is like if I'm deleting the record one by one until unless there will be one record left in the list in a page. (for ex. Page No.3 - only 1 record remain) and If I delete the last record as well the pagination data got change and It will not return the Page-2 and the list also not show any item as I'm showing in the image above.

Thanks

Prince

2023-12-14 09-56-57
Yogesh Javir
Solution

Hi Buddy,

You have to do some manual assign and condition on delete.
Use below If condition after delete
StartIndex<(GetDataById.Count/10)*10

and after that assign below on false
StartIndex-MaxRecords

This is working fine for me

Please mark solution if works

2026-04-23 05-29-20
Prince Kumar

Thanks @Yogesh Javir, for your reply. It works for me :) 

Thanks 

Prince

2022-02-02 14-10-01
Brooks Slocum
Staff
Solution

Adding successful snippet of code in case anyone needs to implement similar functionality. Had to make one minor edit due to the aggregate refresh. Please refer to comments in the screenshot.


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