Ignore:
Timestamp:
Jun 30, 2011, 7:04:14 AM (13 years ago)
Author:
gav
Message:

Fix person list filterpane memory bug on associated properties.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/PersonController.groovy

    r724 r956  
    5353    def list = {
    5454        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100 )
     55        def associatedPropertyMax = 1000
     56        def associatedPropertyValues = [:]
     57        def personGroupNameQuery = 'select distinct a.name from PersonGroup a where a.isActive = ? order by a.name'
     58        associatedPropertyValues.personGroupList = PersonGroup.executeQuery(personGroupNameQuery, [true], [max:associatedPropertyMax])
     59
     60        def authorityQuery = 'select a.authority from Authority a'
     61        associatedPropertyValues.authorityList = Authority.executeQuery(authorityQuery, [max:associatedPropertyMax])
    5562
    5663        if(!params.filter) {
    5764            return [personList: Person.list(params),
    58                             personTotal: Person.count(),
    59                             filterParams: params]
     65                    personTotal: Person.count(),
     66                    associatedPropertyValues: associatedPropertyValues,
     67                    filterParams: params]
    6068        }
    6169
    6270        // filterPane:
    6371        return[ personList: filterService.filter( params, Person ),
    64             personTotal: filterService.count( params, Person ),
    65             filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params),
    66             params:params ]
     72                personTotal: filterService.count( params, Person ),
     73                associatedPropertyValues: associatedPropertyValues,
     74                filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params),
     75                params:params ]
    6776    }
    6877
Note: See TracChangeset for help on using the changeset viewer.