params.max = Math.min(params.max ? params.int('max') : 2, 100)
orders=OrderInfo.createCriteria().listDistinct()
For pagination, we need to pass the params to list eg. Post.list(params). How do I pass it here? I tried but gives an error.
We also require total number which I get.
But I am not able to set params in
orders=OrderInfo.createCriteria().listDistinct()
Pls suggest the correct code
If you pass the params as first parameter of the
listmethod, you get anPagedResultListwhich has the methodgetTotalCount(). With this you could get total number of instances.Read the docs for more information about critera.