Ignore:
Timestamp:
Jan 22, 2010, 5:29:24 PM (15 years ago)
Author:
gav
Message:

Secure and work on import asset tree functions.
Improvements to CustomTagLib.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/taglib/CustomTagLib.groovy

    r286 r290  
    3636        def isChecked, ht, wd, style, html
    3737
     38        def displayFields = attrs.displayFields
     39
     40        def displayValue = " "
     41
    3842        // sets the style to override height and/or width if either of them
    3943        // is specified, else the default from the CSS is taken
     
    5458        from.each { obj ->
    5559
     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
    5671            // if we wanted to select the checkbox using a click anywhere on the label (also hover effect)
    5772            // but grails does not recognize index suffix in the name as an array:
     
    6176            isChecked = (value?.contains(obj."${attrs.optionKey}"))? true: false
    6277
    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>"
    6479        }
    6580
Note: See TracChangeset for help on using the changeset viewer.