• 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
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

How to correctly invoke the doPagination FreeMaker macro

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to make sure the the doPagination FreeMaker macro to support paginating long list of records. However, I couldn't get it right. The following is its source declared in pagination.ftl file:



What does the id parameter of the macro refer to?

Could anyone kindly explain it to me?

Thanks in advance,
Michael Wu
[originally posted on jforum.net by michaelwu]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any kind of ID - a category's ID, a forum id etc..

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
I finally figured it out. Well, although it is declared as one of the call arguments of pagination macro, it is actually optional. If it is not given, a default value of -1 is assumed. Whether it is given or not will affect the way the paging urls are derived. If not given, the derived paging url carries one parameter. If given, the derived paging url carries two parameters. The meaning of these parameters are determined by a corresponding property declared in the urlPattern.properties file. It provides the hint for the action implementation classes to retrieve the parameter values when the user clicks on the derived paging url.

For example, the property in the urlPattern.properties file:
#added by myself
adminLogs.list.1 = log_id

indicates that the paging url http://.../adminLogs/list/25.page carries one parameter - 25. It can be retrieved with the statement request.getParameter("log_id");

In my action implementation class, I thus know which log records should be listed.

This is what I learned from the works in the past two days.

Thanks,
Michael Wu
[originally posted on jforum.net by michaelwu]
 
What's that smell? I think this tiny ad may have stepped in something.
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!