AEM 6.5 : add pagination to list | Community
Skip to main content
Level 2
August 2, 2021
Solved

AEM 6.5 : add pagination to list

  • August 2, 2021
  • 3 replies
  • 4022 views

Hi,

We are implementing a complex list that shows elements with a title, a description, an image and a link. I would like to know what is he best way to implement pagination using only frontend logic ?

Thanks,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi,

We have implemneted the list component with pagination, which get the child pages title, description and image and create a list item with a link.

we created a json service and servlet, which return relavent results based on paginagion, you can pass page number in the json request when click on paginations and get the pagination results at front end side and create a result DOM based on json response, you can use the Query Builder API which support the pagination properties if running queries to fetch pages title, description etc..

3 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 2, 2021

Hi,

We have implemneted the list component with pagination, which get the child pages title, description and image and create a list item with a link.

we created a json service and servlet, which return relavent results based on paginagion, you can pass page number in the json request when click on paginations and get the pagination results at front end side and create a result DOM based on json response, you can use the Query Builder API which support the pagination properties if running queries to fetch pages title, description etc..

Arun Patidar
Umesh_Thakur
Community Advisor
Community Advisor
August 3, 2021

@manal-ghanim , you can use pagination from the front-end purely. We had  implemented it with the help of one open source JS library named Data tables.

It is pretty much easy to use.

More details you can get it on below urls:

https://datatables.net/

 

Hope this will help.

Umesh Thakur

Level 2
August 3, 2021
@umesh_thakur, does datable have an option to display complex data instead of tabular info ? Basically, I wish to render AEM list items and apply paging.
partyush
Community Advisor
Community Advisor
January 17, 2023

Hi Manal-ghanim, 

 

I am facing an issue to implement a proper site pagination, or element pagination, can you please guide me to achieve this via custom code, thanks in advance