title: Finding n-th component nested in a4j:repeat tag in JSF tree
body: <p>I have a problem with finding component in JSF tree. Suppose I have the following template:</p>
  
  <pre><code>&lt;a4j:form id="someForm"&gt;
  &lt;a4j:outputPanel id="somePanel"&gt;
      &lt;a4j:repeat id="people" value="#{bean.people}" rowKeyVar="_row" var="_data" stateVar="_state"&gt;
          &lt;s:decorate id="personPanel" template="edit.xhtml"&gt;
  
              &lt;h:outputLabel for="personAge" value="Choose your age:" /&gt;
  
              &lt;h:selectOneMenu id="personAge" value="#{_data.age}"&gt;
                  &lt;s:selectItems var="_item" value="#{ageValues}" label="#{_item.description}" /&gt;
              &lt;/h:selectOneMenu&gt;
  
          &lt;/s:decorate&gt;
      &lt;/a4j:repeat&gt;
  &lt;/a4j:outputPanel&gt;
  &lt;/a4j:form&gt;
  </code></pre>
  
  <p>Namespaces are defined as:</p>
  
  <pre><code>xmlns:a4j="http://richfaces.org/a4j"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:s="http://jboss.com/products/seam/taglib"
  </code></pre>
  
  <p>As you can see, there is a <code>a4j:repeat</code> tag, so there can be <em>n</em> rendered select inputs on the page. How can I find <em>n</em>-th component in JSF tree at the server side? At the client side, components are rendered like: <code>someForm:somePanel:0:personPanel:personAge</code>. I'm trying to find component this way:</p>
  
  <pre><code>UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
  UIInput ageInput = (UIInput) root.findComponent("someForm:somePanel:0:personPanel:personAge");
  </code></pre>
  
  <p>But it couldn't be find. I've checked tree, and it seems like component with that id doesn't exist.</p>
  
  <p>So how can I obtain this component? Is there any way to achieve that?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I've found some workaround. Actually, I didn't need components, but their values. Values can be retrieved from request by their names. Following code:</p>
  
  <pre><code>FacesContext facesContext = FacesContext.getCurrentInstance();
  String ageValue = facesContext.getExternalContext().getRequestParameterMap().get("someForm:somePanel:0:personPanel:personAge");
  </code></pre>
  
  <p>did the work.</p>