grails - Maintaining page number across requests -


i have button on client side , when press, execute action on server , call list method again. works fine let's i'm on page 3 , click item, when page refreshes takes me page 1. don't know page i'm on. there way maintain page number?

you need pass offset , max parameters through request. can pass current params link tag, if you're using it:

<g:link action="myaction" params="${[offset: params.offset, max: params.max]}"/> 

if you're not using <g:link>, can make them query parameters in href:

<a href="/path/to/action?max=${params.max}&offset=${params.offset}">link</a> 

these params need make .list() method in controller (e.g. .list(params)).

as long params set in action renders resulting view, <g:paginate> tag pick them , render pagination links correctly.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -