title: grails domain class .list() method with params
body: <p>I have two domains that are connected with one-to-many relation - One User may have many Associations. I want to view all associations that belong to this user. I'm using scaffolding plugin. So code that should return list of Associations in AssociationController looks lile this:</p>
  
  <pre><code>def index(Integer max) {
      respond Association.list(params), model:[associationInstanceCount: Association.count()]
  }
  </code></pre>
  
  <p>And on the User view page I have the following code:</p>
  
  <pre><code>&lt;g:form controller="Association" &gt;
      &lt;fieldset class="buttons"&gt;
          &lt;g:hiddenField name="user.id" id="user.id" value="${userInstance.id}"/&gt;
          &lt;g:actionSubmit class="list" action="index" value="${message(code: 'default.list.label', default: 'Show Associations')}"/&gt;
      &lt;/fieldset&gt;
  &lt;/g:form&gt;
  </code></pre>
  
  <p>When I press this actionSubmit <code>user.id</code> is sent with the request and it is within params map (I checked it with debug) but for some reason <code>Association.list(params)</code> returns all Associations (for all users) despite the fact that I'm using this user.id within params. A also tried rename <code>user.id</code> to just <code>user</code> and it didn't work either. Seems like this .list() should be used only for sorting or I'm doing something wrong. Can you help me with this please? Thank you!</p>