• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Pagination [Need Early reply]

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to work with the Pagination.

I have one page & I want to paginate that page for 5 entries.

The page consists of random topic_id, topic_tile.

Can u please help me to solve this issue.

Your kind & early reply is soliciated.

Thanks & Regards,

KUNAL


[originally posted on jforum.net by kunal2383]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Fremarker, add the following line to your file:



Then, make a call to the pagination macro, as in



Where "action" is the JForum action name to there the link should point to. This macro expects the following variables to exist in the Freemarker context:

- totalRecords: how many records exist
- recordsPerPage: how many to display per page
- totalPages: how many pages exist for this record set
- thisPage: the current page number
- contextPath: Application's context path
- moduleName: JForum's module name to send to
- extension: JForum servlet extension
- I18n: a valid instance of the class I18n

The macro source code is at templates/macros/pagination.ftl

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot...................it works.................
[originally posted on jforum.net by kunal2383]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!