Index: /trunk/grails-app/domain/Asset.groovy
===================================================================
--- /trunk/grails-app/domain/Asset.groovy	(revision 342)
+++ /trunk/grails-app/domain/Asset.groovy	(revision 343)
@@ -26,11 +26,17 @@
     }
 
-    //  This additional setter is used to convert the checkBoxList string
+    //  This additional setter is used to convert the checkBoxList string or string array
     //  of ids selected to the corresponding domain objects.
     public void setAssetSubItemsFromCheckBoxList(ids) {
         def idList = []
-        ids.each() {
-            if(it.isInteger())
-                idList << it.toInteger()
+        if(ids instanceof String) {
+                if(ids.isInteger())
+                    idList << ids.toInteger()
+        }
+        else {
+            ids.each() {
+                if(it.isInteger())
+                    idList << it.toInteger()
+            }
         }
         this.assetSubItems = idList.collect { AssetSubItem.get( it ) }
Index: /trunk/grails-app/domain/Person.groovy
===================================================================
--- /trunk/grails-app/domain/Person.groovy	(revision 342)
+++ /trunk/grails-app/domain/Person.groovy	(revision 343)
@@ -55,11 +55,17 @@
     String toString() {"${this.firstName} ${this.lastName}"}
 
-    //  This additional setter is used to convert the checkBoxList string
+    //  This additional setter is used to convert the checkBoxList string or string array
     //  of ids selected to the corresponding domain objects.
     public void setPersonGroupsFromCheckBoxList(ids) {
         def idList = []
-        ids.each() {
-            if(it.isInteger())
-                idList << it.toInteger()
+        if(ids instanceof String) {
+                if(ids.isInteger())
+                    idList << ids.toInteger()
+        }
+        else {
+            ids.each() {
+                if(it.isInteger())
+                    idList << it.toInteger()
+            }
         }
         this.personGroups = idList.collect { PersonGroup.get( it ) }
Index: /trunk/grails-app/taglib/CustomTagLib.groovy
===================================================================
--- /trunk/grails-app/taglib/CustomTagLib.groovy	(revision 342)
+++ /trunk/grails-app/taglib/CustomTagLib.groovy	(revision 343)
@@ -16,11 +16,17 @@
      * To map the selected ids to corresponding domain objects,
      * an additional set method is required in the containing domain class:
-     *       //  This additional setter is used to convert the checkBoxList string
+     *       //  This additional setter is used to convert the checkBoxList string or string array
      *       //  of ids selected to the corresponding domain objects.
      *       public void setAssetSubItemsFromCheckBoxList(ids) {
      *           def idList = []
-     *           ids.each() {
-     *               if(it.isInteger())
-     *                   idList << it.toInteger()
+     *           if(ids instanceof String) {
+     *                   if(ids.isInteger())
+     *                       idList << ids.toInteger()
+     *           }
+     *           else {
+     *               ids.each() {
+     *                   if(it.isInteger())
+     *                       idList << it.toInteger()
+     *               }
      *           }
      *           this.assetSubItems = idList.collect { AssetSubItem.get( it ) }
@@ -35,5 +41,7 @@
      *    value - the current value.
      *    optionKey - the key to use.
-     *    displayFields - (optional) available options are 'id' and 'name', defaults to the objects toString().
+     *    sortBy - (optional) the attribute to sort the from list by.
+     *    displayFields - (optional) defaults to the objects toString()
+     *    displayFieldsSeparator - (optional) defaults to a space.
      *    linkController - (optional, requires linkAction.) the controller to use for a link to the objects in the checkBoxList.
      *    linkAction - (optional, requires linkController.) the action to use for a link to the objects in the checkBoxList.
@@ -45,5 +53,7 @@
      *                                    value="${assetInstance?.assetSubItems.collect{it.id}}"
      *                                    optionKey="id"
+     *                                    sortBy="description"
      *                                    displayFields="['id', 'name']"
+     *                                    displayFieldsSeparator=', '
      *                                    linkController="assetSubItemDetailed"
      *                                    linkAction="show"/>
@@ -59,5 +69,7 @@
         def isChecked, ht, wd, style, html
 
+        def sortBy = attrs.sortBy
         def displayFields = attrs.displayFields
+        def displayFieldsSeparator = attrs.displayFieldsSeparator ?: ' '
         def linkController = attrs.linkController
         def linkAction = attrs.linkAction
@@ -81,21 +93,21 @@
         out << html
 
+        if(sortBy)
+            from.sort { p1, p2 -> p1[sortBy].compareToIgnoreCase(p2[sortBy]) }
+
         from.each { obj ->
 
             displayValue = " "
 
-            if( displayFields?.contains("id") )
-                displayValue += obj.id + " - "
-
             if(linkController && linkAction)
                    displayValue += "<a href=\"${createLink(controller: linkController, action: linkAction, id: obj.id).encodeAsHTML()}\">"
 
-            if(displayFields?.contains("name")) {
-                displayValue += obj.name
+            if(displayFields) {
+                displayValue += displayFields.collect { obj[it] }.join(displayFieldsSeparator)
             }
-            else displayValue += obj
+            else displayValue += obj // use the obj's default toString()
 
             if(linkController && linkAction)
-                displayValue += '</a>'
+                displayValue += "</a>"
 
             // if we wanted to select the checkbox using a click anywhere on the label (also hover effect)
