Changeset 290 for trunk/grails-app/taglib/CustomTagLib.groovy
- Timestamp:
- Jan 22, 2010, 5:29:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/CustomTagLib.groovy
r286 r290 36 36 def isChecked, ht, wd, style, html 37 37 38 def displayFields = attrs.displayFields 39 40 def displayValue = " " 41 38 42 // sets the style to override height and/or width if either of them 39 43 // is specified, else the default from the CSS is taken … … 54 58 from.each { obj -> 55 59 60 displayValue = " " 61 62 if( displayFields?.contains("id") ) { 63 displayValue += obj.id + " - " 64 } 65 66 if(displayFields?.contains("name")) { 67 displayValue += obj.name 68 } 69 else displayValue += obj 70 56 71 // if we wanted to select the checkbox using a click anywhere on the label (also hover effect) 57 72 // but grails does not recognize index suffix in the name as an array: … … 61 76 isChecked = (value?.contains(obj."${attrs.optionKey}"))? true: false 62 77 63 out << "<li>" << checkBox(name:cname, value:obj."${attrs.optionKey}", checked: isChecked) << " ${obj.id} - ${obj.name}"<< "</li>"78 out << "<li>" << checkBox(name:cname, value:obj."${attrs.optionKey}", checked: isChecked) << displayValue << "</li>" 64 79 } 65 80
Note: See TracChangeset
for help on using the changeset viewer.