title: JSF multiple groups of selectOneRadio on a page: how to recover the values?
body: <p>I have a jsf page with multiple radiobutton groups (dynamically generated) on it. I need to retrieve the values from it in a backing bean, but fails to do so.</p>
  
  <p>The business: a user wants to subscribe to a course that consists of multiple groups of coursedays. The user can choose the coursedays. So if a course consists of for example 4 coursedays, organised in 3 different groups, the user can choose from 12 coursedays, in blocks of 3. </p>
  
  <p>The relevant part of the xhtml-page:</p>
  
  <pre><code>&lt;c:forEach var="cd1" items="#{coursedayBean.getCoursedays(groupBean.getFirstGroup}"&gt;
    &lt;h:selectOneRadio value="#{subscriptionBean.selectedCoursedays[cd1.sequenceNr]}" &gt;
      &lt;f:selectItems value="#{coursedayBean.getCoursedaysSelectItems}"/&gt;
    &lt;/h:selectOneRadio&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>This results in a n*m matrix of radiobuttons where I want to retrieve n values.
  The selectItems are of type <code>&lt;Long, String&gt;</code>.</p>
  
  <p>In my backing bean, I declared the following:</p>
  
  <pre><code>public List&lt;String&gt; getSelectedCoursedays() {
    return selectedCoursedays;
  }
  
  public void setSelectedCoursedays(List&lt;String&gt; selectedCoursedays) {
    this.selectedCoursedays = selectedCoursedays;
  }
  </code></pre>
  
  <p>I tried with a Map, List, but none of them worked. The setSelectedCoursedays is never called.
  How do I declare the array/list/map to get the values in my backing bean?</p>
  
  <pre><code>#{subscriptionBean.selectedCoursedays[cd1.sequenceNr]}
  </code></pre>
  
  <p>doesn't do the trick.</p>