- Timestamp:
- Jan 21, 2010, 4:07:26 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 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> -
trunk/web-app/css/main.css
r282 r286 581 581 margin: 2px; 582 582 } 583 584 /* CheckBoxList Tag Lib */ 585 586 .CheckBoxList { 587 height: 300px; 588 overflow: auto; 589 overflow-x: hidden; 590 width: 400px; 591 border: 1px solid #ccc; 592 list-style-type: none; 593 margin: 0; 594 padding: 0px; 595 } 596 .CheckBoxList li { 597 padding: 5px; 598 }
Note: See TracChangeset
for help on using the changeset viewer.