title: JSF unique input bean for each item in a loop
body: <p>I want to iterate over a list of elements and for each element I want to display a form. In that form I want to be able to fill a bean that is different for each element of the loop. Here's what I got so far but of course it doesn't work ;)</p>
  
  <pre><code>    &lt;ui:repeat value="#{productBean.productPositions}" var="position"&gt;
          &lt;div&gt;position info here&lt;/div&gt;
          &lt;div&gt;list price ranges&lt;/div&gt;
          &lt;div&gt;
              &lt;h5&gt;Create new price range for product position position&lt;/h5&gt;
              &lt;h:form&gt;
                  Min:
                  &lt;h:inputText
                      value="#{priceRangeBean.priceRanges[productPositionRangeSearch.productPositions.indexOf(position)].min}" /&gt;
                  Max:
                  &lt;h:inputText
                      value="#{priceRangeBean.priceRanges[productPositionRangeSearch.productPositions.indexOf(position)].max}" /&gt;
                  price:
                  &lt;h:inputText
                      value="#{priceRangeBean.priceRanges[productPositionRangeSearch.productPositions.indexOf(position)].price}" /&gt;
                  &lt;h:commandButton value="create"
                      action="#{priceRangeController.createRange(productPositionRangeSearch.productPositions.indexOf(position))}" /&gt;
              &lt;/h:form&gt;
  
          &lt;/div&gt;
      &lt;/ui:repeat&gt;
  </code></pre>
  
  <p>my PriceRangeBean:</p>
  
  <pre><code>@SessionScope
  public class PriceRangeBean {
  
      private List&lt;PriceRange&gt; priceRanges = new ArrayList&lt;PriceRange&gt;();
  
      public List&lt;PriceRange&gt; getPriceRanges() {
          return priceRanges;
      }
  
      public void setPriceRanges(List&lt;PriceRange&gt; priceRanges) {
          this.priceRanges = priceRanges;
      }
  
  }
  </code></pre>
  
  <p>with <code>PriceRange</code> being a POJO containing min, max, price as <code>String</code></p>
  
  <p>The controller calling the page fills the <code>PriceRangeBean</code> with as many <code>PriceRange</code>s as there are <code>ProductPosition</code>s so that there is a "new" <code>PriceRange</code> Object in the list ready to be created. However the input doesn't seem to reach the backing bean.</p>
  
  <p>Any ideas what I'm doing wrong?</p>
  
  <p>Thanks!</p>