I am new to grails and I tried using the grail pagination Tag found in grails documentation, I have a search form in my index.gsp
I don't know how to pass params.max and params.offset I use only one action index
I have an index action containing a query to list some books:
params.max = 10
params.offset = 0
def author=params.author
def max = 10
def offset = 0
if(params.max){
max = params.max
}
if(params.offset){
offset = params.offset
}
def bookPagin=Book.createCriteria().list {
eq("author", author)}
maxResults(max)
firstResult(offset )
}
this is the paginate tag in my index.gsp:
<g:paginate controller="displayBook" action="index" total="${bookPagin.size()}" params="[author:author]"/>
now this code displays the first 10 results, but when I click on the second page it does not accept the parameters of the input author, although I try to change the author parameter in the GET request, is there any other solution?
source
share