title: Cannot get value from an object within a list in GSP
body: <p>I am a newbie in Groovy and grails. I want to display the current project of an employee in employee List. I can only get the current project of an employee by going to <code>ProjectMember</code> class. My idea is that I get the current project of every employee and then put it in a list which I then iterate over in the <code>.gsp</code>. </p>
  
  <pre><code>class EmployeeController {
  
      def list = {
          params.max = Math.min(params.max ? params.int('max') : 10, 100)
  
          def currentProject = [ProjectMember];
          List&lt;Employee&gt; employeeList = Employee.list(params)
          System.out.print("PREV SIZE" + currentProject.size())
          for(Employee emp: employeeList) {
              def current = ProjectMember.findAllByEmployeeAndEndDateIsNull(emp, [sort: "project.name", order: "asc"])
              System.out.print(current.project.name);
              // This is working, I can get the current projects of the employee
              if(!current.empty) {                     
                  currentProject.add(current);
                  // Here is the code I didn't understand I really don't know 
                  // if the project is added in the list.
                  // Everytime I try to display the contents of the list using foreach, 
                  // I always get an error. MissingProperty
              }
          }
  
          [currentProject: currentProject,
           employeeInstanceList: Employee.list(params),
           employeeInstanceTotal: Employee.count()]
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>class ProjectMember {
      Employee employee
      EmployeeRole role
      Date startDate
      Date endDate
      String notes
  
      static belongsTo = [project: Project]
  }
  </code></pre>
  
  <hr>
  
  <pre><code>class Project {
      String name
      String alternateName
      boolean useAlternateNameInResume = false
  
      String summary
      String duration
      String skills
      String technologies
  
      Date startDate
      Date endDate
  
      static hasMany = [members: ProjectMember]
  }
  </code></pre>
  
  <hr>
  
  <p>And lastly the view, <code>list.gsp</code>:</p>
  
  <pre><code>&lt;g:each in="${employeeInstanceList}" status="i" var="employeeInstance"&gt;
      &lt;tr class="${(i % 2) == 0 ? 'odd' : 'even'} clickable" onclick="window.location='&lt;g:createLink action='show' id='${employeeInstance.id}' /&gt;'"&gt;
          &lt;td&gt;${employeeInstance.idNo?.encodeAsHTML()}&lt;/td&gt;
          &lt;td&gt;${fieldValue(bean: employeeInstance, field: "fullNameWithMiddleName")}&lt;/td&gt;
          &lt;td&gt;${employeeInstance.position}&lt;/td&gt;
          &lt;td&gt;
              &lt;g:each in="${currentProject}" var="currentProject" status ="j"&gt;                                            
                  ${fieldValue(bean: currentProject, field: "project.name")}
              &lt;/g:each&gt;
              &lt;g:if test="${currentProject.empty}"&gt;
                  No projects yet
              &lt;/g:if&gt; 
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/g:each&gt;
  </code></pre>
  
  <p>Everything works fine except for the current project which doesn't display anything.</p>