title: In Grails how do I capture multiple selected items in g:select?
body: <p>I have a Contact Domain class that can be associated with multiple Organizations, which are also domain classes. I want to use a multiple selection box to allow the user to select the organizations that are associated with the current contact. The selection box is populated with the available organizations. How do I assign the selected items to the organizations list in my Contact class?</p>
  
  <pre><code> &lt;g:select name="organizations.id"  
             multiple="multiple" 
             optionKey="id" 
             from="${com.ur.Organization.list()}" 
             value="${contact?.organizations}" /&gt;
  </code></pre>
  
  <p>The above is what I am currently trying, and while it does populate the selection with organizations it doesn't seem to put the selected items in my organizations field.</p>
  
  <p>Thanks for any advice.</p>
  
  <p>Edit:
  Incorporated comments from krsjunk and omarello.</p>
  
  <p>Here's an abbreviated version of the domain classes.</p>
  
  <pre><code>class Contact{
      static searchable = true
      static mapping = {
          sort "lastName"
      }
      String firstName
      String lastName
      .  
      .
      .
      static belongsTo = [organizations:Organization, projects:Project]
  }
  
  class Organization {
      static searchable = true
      static mapping = {
          sort "name"
      }
      String name
      static hasMany = [contacts:Contact]
  }
  </code></pre>