Told you, we love sharing!
I have been using the following code to get paginated result and the total number of results returned irrespective of the pagination params. def result=SampleDomain.createCriteria().list(){ // multiple restrictions maxResults(params.max) firstResult(params.offset) } // Return type is ArrayList Integer totalResult=SampleDomain.createCriteria().count(){ // multiple restrictions // maxResults(params.max) // firstResult(params.offset) } Clearly duplicating the same closure except for the pagination […]
following are two methods for getting parameters from GSP in form of list only:- even if the variable has only one value, it will be recieved as a list and not as “String”. List<String> myList = params.list(‘variableName’) List<String> myList = [params.variableName].flatten() ~~Niraj Kumar~~ niraj@intelligrape.com http://www.tothenew.com