title: JSF view calculations
body: <p>I know that with JSF 2, facelets is the preferred view declaration language.</p>
  
  <p>Is JSP to jsf deprecated?</p>
  
  <p>Anyway, I need to create a special layout so I cannot use Datatable. Instead, I have 6 divs that I use as columns in which I drop a collection of Articles.
  My problem is that I have a JSF composite component, that is injected with a Collection
  A:</p>
  
  <pre><code>List&lt;Article&gt;
  </code></pre>
  
  <p>object.</p>
  
  <p>The component then needs to divide the size of the collection into equal pieces for each column. Then set the appropiate offset and size for each</p>
  
  <pre><code>&lt;ui:repeat&gt;&lt;/ui:repeat&gt; 
  </code></pre>
  
  <p>so i end up with this</p>
  
  <pre><code>&lt;!-- INTERFACE --&gt;
  &lt;cc:interface&gt;
      &lt;cc:attribute name="featuredArticles" required="true" type="java.util.List;" /&gt;
  &lt;/cc:interface&gt;
  
  &lt;!-- IMPLEMENTATION --&gt;
    &lt;cc:implementation&gt;
      &lt;div class="col"&gt;
         &lt;ui:repeat value="#{cc.attrs.featuredArticles}" var="art" offset="??" size="??"&gt;
              &lt;mycomps:article art="#{art}" /&gt;
         &lt;/ui:repeat&gt;
      &lt;/div&gt;
      &lt;div class="col"&gt;
         &lt;ui:repeat value="#{cc.attrs.featuredArticles}" var="art" offset="??" size="??"&gt;
              &lt;mycomps:article art="#{art}" /&gt;
         &lt;/ui:repeat&gt;
      &lt;/div&gt;
      &lt;div class="col"&gt;
         &lt;ui:repeat value="#{cc.attrs.featuredArticles}" var="art" offset="??" size="??"&gt;
              &lt;mycomps:article art="#{art}" /&gt;
         &lt;/ui:repeat&gt;
      &lt;/div&gt;
      &lt;div class="col"&gt;
         ...same here...
      &lt;/div&gt;
      &lt;div class="col"&gt;
         ...same here...
      &lt;/div&gt;
  &lt;/cc:implementation&gt;
  </code></pre>
  
  <p>So how do I calculate those offsets and sizes so that each columns iterates over a portion of the collection? Or maybe there's a better way?</p>