Ignore:
Timestamp:
Feb 10, 2010, 2:49:13 AM (14 years ago)
Author:
gav
Message:

Improvements to CustomTagLib checkBoxList, sorting, dynamic displayFields and a small fix to the domain class set method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/Person.groovy

    r294 r343  
    5555    String toString() {"${this.firstName} ${this.lastName}"}
    5656
    57     //  This additional setter is used to convert the checkBoxList string
     57    //  This additional setter is used to convert the checkBoxList string or string array
    5858    //  of ids selected to the corresponding domain objects.
    5959    public void setPersonGroupsFromCheckBoxList(ids) {
    6060        def idList = []
    61         ids.each() {
    62             if(it.isInteger())
    63                 idList << it.toInteger()
     61        if(ids instanceof String) {
     62                if(ids.isInteger())
     63                    idList << ids.toInteger()
     64        }
     65        else {
     66            ids.each() {
     67                if(it.isInteger())
     68                    idList << it.toInteger()
     69            }
    6470        }
    6571        this.personGroups = idList.collect { PersonGroup.get( it ) }
Note: See TracChangeset for help on using the changeset viewer.