title: Grails: I want to evaluate the name of a list when dynamically building a drop down
body: <p>I have a generic DropDown object that holds the name of a given collection. When it is loaded I would like this name "evaluated" and the proper collection loaded.</p>
  
  <p>For example:</p>
  
  <p>The DropDownObject:</p>
  
  <pre><code>class DDObject{
    String collectionName
  }
  </code></pre>
  
  <p>In the controller:</p>
  
  <pre><code>def collection1 = ["1","2","3","4"]
  ...
  DDObject dd = new DDObject()
  dd.collectionName = "collection1"
  ...
  [collection1:collection1,dropDown:dd]
  </code></pre>
  
  <p>(different dropdowns share different collections over the whole controller so I didn't want to add the collection specifically to the DD object)</p>
  
  <p>in the gsp - something like:</p>
  
  <pre><code>&lt;g:select name="foo" from="${Eval.me(dropDown.collectionName)}" /&gt;
  </code></pre>
  
  <p>(in other words - evaluate the name of the collection and get the specific collection from the map passed from the controller to the gsp)</p>
  
  <p>I realize there are other ways to do this, but is this kind of "Eval" possible in this context?</p>
  
  <p>thanks!</p>