Changeset 286 for trunk/grails-app
- Timestamp:
- Jan 21, 2010, 4:07:26 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/AssetDetailedController.groovy
r284 r286 218 218 } 219 219 } 220 220 221 assetInstance.properties = params 222 223 assetInstance.setAssetSubItemsFromCheckBoxList(params.assetSubItems) 224 221 225 if(!assetInstance.hasErrors() && assetInstance.save(flush: true)) { 222 226 flash.message = "Asset ${params.id} updated" -
trunk/grails-app/domain/Asset.groovy
r268 r286 23 23 "${this.name}" 24 24 } 25 26 // This additional setter is used to convert the checkBoxList string 27 // of ids selected to the corresponding domain objects. 28 public void setAssetSubItemsFromCheckBoxList(ids) { 29 def idList = [] 30 ids.each() { 31 if(it.isInteger()) 32 idList << it.toInteger() 33 } 34 this.assetSubItems = idList.collect { AssetSubItem.get( it ) } 35 } 36 25 37 } 26 38 -
trunk/grails-app/taglib/AssetTreeTagLib.groovy
r285 r286 1 1 /** 2 * Asset Tree tags. 3 * Specific to gnumims hence the namespace. 4 */ 2 5 class AssetTreeTagLib { 3 6 static namespace = 'gnumims' -
trunk/grails-app/views/assetDetailed/edit.gsp
r276 r286 85 85 </td> 86 86 <td valign="top" class="value ${hasErrors(bean:assetInstance,field:'assetSubItems','errors')}"> 87 88 <g:select name="assetSubItems" 89 from="${AssetSubItem.list()}" 90 size="5" multiple="yes" optionKey="id" 91 value="${assetInstance?.assetSubItems}" /> 87 <custom:checkBoxList name="assetSubItems" 88 from="${AssetSubItem.list()}" 89 value="${assetInstance?.assetSubItems.collect{it.id}}" 90 optionKey="id"/> 92 91 93 92 </td>
Note: See TracChangeset
for help on using the changeset viewer.