title: grails exception: Tag [paginate] is missing required attribute [total]
body: <p>I've the following method in my controller, that is used to list the Patient entities:</p>
  
  <pre><code>def list(Integer max) {
      params.max = Math.min(max ?: 10, 100)
  
  
      def roles = springSecurityService.getPrincipal().getAuthorities()
      if(roles == 'ROLE_USER')
      {
          [patientInstanceList: Patient.findAllBySecUser(springSecurityService.getCurrentUser()), patientInstanceTotal: Patient.count()]
      }
      else if(roles == 'ROLE_ADMIN' || roles == 'ROLE_MANAGER')
      {
          [patientInstanceList: Patient.list(params), patientInstanceTotal: Patient.count()]
      }
  }
  </code></pre>
  
  <p>If I perform this method I have the exception</p>
  
  <pre><code>Tag [paginate] is missing required attribute [total]
  </code></pre>
  
  <p>But, if I use the following</p>
  
  <pre><code>def list(Integer max) {
      params.max = Math.min(max ?: 10, 100)
      [patientInstanceList: Patient.list(params), patientInstanceTotal: Patient.count()]
      }
  }
  </code></pre>
  
  <p>Everything works well. I see all the instances of Patient created. I only want that, based on role of user logged in, I can see a part of all the entities created. Why does this exception is raised?</p>
  
  <p>I've found here <a href="https://stackoverflow.com/questions/4944839/grails-pagination-tag-error">Grails pagination tag error</a> something similar, but no good answer was given</p>