title: java.lang.NumberFormatException: Trying to extract rowIndex from clientId
body: <p>I'm developing a dynamic form using Mojarra 2.2.5 and Primefaces 4.0 and i need to implement a datatable with dynamic content. Unfortunately when i try to submit form appears this error: </p>
  
  <pre><code>java.lang.NumberFormatException: Trying to extract rowIndex from clientId 'id_of_my_datatable:j_id1:j_id1'
  </code></pre>
  
  <p>I generated datatable by code using it, inspired by Primefaces Showcase (<a href="http://primefaces.org/showcase/ui/datatableDynamicColumns.jsf" rel="nofollow noreferrer" title="Showcase">http://primefaces.org/showcase/ui/datatableDynamicColumns.jsf</a>) and from (<a href="https://stackoverflow.com/questions/13176842/dynamically-generate-hcolumn-based-on-list-of-hashmaps">Stack Overflow discussion</a>)</p>
  
  <pre><code>    private DataTable addList(UIComponent parent, String labelStr, String id, List&lt;ColumnModel&gt; rowItems, List&lt;Map&lt;String, String&gt;&gt; values, String styleClass,
          boolean isRequired, String updateComponents)
  {
      OutputPanel outputPanel = new OutputPanel();
      outputPanel.setStyleClass("question_panel col-md-11");
  
      if (labelStr != null)
      {
       addLabel(outputPanel, id, labelStr, "component_label col-md-11");
      }
  
      DataTable dataTable = new DataTable();
      dataTable.setValue(values);
      //mapModel = values;
      //ValueExpression veTable = super.createValueExpression("#{composerTestBean.mapModel}", List.class);
      //dataTable.setValueExpression("value", veTable);
      dataTable.setVar("model");
      dataTable.setId(id);
      dataTable.setRowIndexVar("rowIndex");
  
      Columns columns = new Columns();
      columns.setValue(rowItems);
      //columnModel = rowItems;
      //ValueExpression veColumns = super.createValueExpression("#{composerTestBean.columnModel}", List.class);
      //columns.setValueExpression("value", veColumns);
      columns.setVar("column");
      columns.setColumnIndexVar("colIndex");
  
      HtmlOutputText headerText = new HtmlOutputText();
      ValueExpression veHeader = super.createValueExpression("#{column.header}", String.class);
      headerText.setValueExpression("value", veHeader);
      columns.getFacets().put("header", headerText);
  
      HtmlOutputText valueText = new HtmlOutputText();
      ValueExpression veValue = super.createValueExpression("#{model[column.property]}", String.class);
      valueText.setValueExpression("value", veValue);
      columns.getChildren().add(valueText);
  
      dataTable.getChildren().add(columns);
  
      outputPanel.getChildren().add(dataTable);
  
      parent.getChildren().add(outputPanel);
  
      return dataTable;
  }
  </code></pre>
  
  <p>As you can see I've also tried to use valueExpression and the property bean binding, but nothing is changed. <code>setRowIndexVar()</code> and <code>setColumnIndexVar()</code> methods are just attempts to resolve the question.</p>
  
  <p>I also read that it could be a Mojarra bug on <a href="https://stackoverflow.com/questions/10717753/java-lang-numberformatexception-trying-to-extract-rowindex-from-clientid-j-idt">this discussion</a> (it should be resolved) and in another one that is a <a href="http://forum.primefaces.org/viewtopic.php?f=3&amp;t=16208" rel="nofollow noreferrer">Primefaces bug</a> (I can't apply patches on project libraries).</p>
  
  <p>Also I try to follow <a href="http://matoosfe.com/blog/?p=167" rel="nofollow noreferrer">this post</a> and this remove this exception but brings others problem to my page about update.</p>
  
  <p>Do You think I'm doing something wrong? Or Is it just an unresolvable case?
  Thanks in advance.</p>