Grails

Criteria Query and pagination params

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 ...

by Bhagwat Kumar
Tag: GORM list()
14-Jul-2010

Grails

Getting params attribute as list()

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 ...

by niraj
Tag: GORM list()
14-Jun-2010