When creating an object that has a hasMany property, this propery will only be set using a "g:select" tag with "multiple" attribute set to true. Grails should not discriminate which DOM object allows binding to hasMany relationships. If a list of id's are sent as params to a controller and the corresponding domain object has a field that is a Collection, the binding should occur no matter if the list was sent from a multi-select box or a custom tag that also sends a list of id's.
Background: I wrote a custom tag for multi-selection using checkboxes instead of a multi-select list (from a UI perspective, it only makes more sense). When submitting, I notice that the corresponding Set in my domain object is always null. When I change from my custom tag to "g:select" w/ "multiple" set to true, the corresponding Set in my domain has all the correct values. Both my tag and the g:select tab send the same list, but the only noticeable differences are
1) g:select sends a multiple flag and my checkboxes cannot do that
2) g:select does not send hidden fields, checkboxes send hidden fields, and the hidden fields are not populated (seperate bug??)