Changeset 956
- Timestamp:
- Jun 30, 2011, 7:04:14 AM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/PersonController.groovy
r724 r956 53 53 def list = { 54 54 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]) 55 62 56 63 if(!params.filter) { 57 64 return [personList: Person.list(params), 58 personTotal: Person.count(), 59 filterParams: params] 65 personTotal: Person.count(), 66 associatedPropertyValues: associatedPropertyValues, 67 filterParams: params] 60 68 } 61 69 62 70 // filterPane: 63 71 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 ] 67 76 } 68 77 -
trunk/grails-app/views/person/list.gsp
r836 r956 13 13 14 14 <div class="body"> 15 <g:if test="${flash.message}"> 16 <div class="message">${flash.message}</div> 17 </g:if> 15 <g:render template="/shared/messages" /> 16 18 17 <filterpane:currentCriteria domainBean="Person" 19 18 action="list" 20 19 dateFormat="EEE, dd-MMM-yyyy" 21 removeImgDir="images" 20 removeImgDir="images" 22 21 removeImgFile="bullet_delete.png" 23 22 title="Search"/> … … 121 120 122 121 <filterpane:filterPane domainBean="Person" 123 124 125 126 127 128 filterPropertyValues="${['personGroups.name':[values:PersonGroup.list()],129 'authorities.authority':[values:Authority.list()]]}" />122 title="Search" 123 action="list" 124 class="overlayPane" 125 excludeProperties="password, sessionTimeout" 126 associatedProperties="authorities.authority, personGroups.name" 127 filterPropertyValues="${['personGroups.name':[values: associatedPropertyValues.personGroupList], 128 'authorities.authority':[values: associatedPropertyValues.authorityList]]}" /> 130 129 131 130
Note: See TracChangeset
for help on using the changeset viewer.