title: Grails/GSP: break out of <g:each>
body: <p>Is there a way to break out of a &lt;g:each>? I have a page wherein I'm iterating through a list and I have to make sure that a checkbox is checked if that was the value stored in DB.</p>
  
  <p>To make it a little clearer, please consider something like:</p>
  
  <pre><code>&lt;g:each in=${list1}&gt;
      &lt;g:each in=${list2}&gt;
          &lt;g:if test="${list1.id == list2.id}"&gt;
              &lt;input type="checkbox" ... checked="checked" /&gt;
          &lt;/if&gt;
      &lt;/g:each&gt;
      ...
  &lt;/g:each&gt;
  </code></pre>
  
  <p>where list1 is, say Domain1.list() (i.e. ALL possible values) and list2 is Domain2.find(...) (i.e. SELECTED values)</p>
  
  <p>In the g:each, I need to display ALL of list1 (hence, the "..." after the inner each) with a checkbox but I need to make sure that those in list2 (user-selected items that were saved to DB) should be checked accordingly (if statement).</p>
  
  <p>Now, if the checked status was changed on the first iteration, i need to get out of the inner each... any way to do this?</p>
  
  <p>Thanks!</p>