0 Replies Latest reply on Jul 17, 2008 2:26 PM by Kristen McGregor

    rich:DataTable in rich:tabPanel

    Kristen McGregor Newbie

      Hey all,
      I'm using a rich:dataTable within a rich:tabPanel and am getting the following error:

      javax.servlet.ServletException: duplicate Id for a component j_id_jsp_917984629_12:j_id_jsp_917984629_14
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)


      I am using the following markup:
      <!-- Main Tabs -->
      <rich:tabPanel switchType="server" headerClass="tab-header"
       contentClass="tab-content">
       <rich:tab label="Home">
       <rich:dataTable value="#{testBean.results}" var="row"
       style="text-align:left" rows="10">
       <rich:columns value="#{testBean.columnHeaders}" var="columnHeader" >
       <f:facet name="header">
       <h:outputText value="#{columnHeader}" />
       </f:facet>
       <h:outputText value="#{row[columnHeader]}" />
       </rich:columns>
       <f:facet name="footer">
       </f:facet>
       </rich:dataTable>
       </rich:tab>
       <rich:tab label="Program View">
       </rich:tab>
      </rich:tabPanel>


      ... and the following TestBean:
      public class TestBean {
      
       private List<Map<String,String>> results;
       private List<String> columnHeaders;
      
       public TestBean()
       {
       columnHeaders = new ArrayList<String>();
       columnHeaders.add("col1");
       columnHeaders.add("col2");
       columnHeaders.add("col3");
       results = new ArrayList<Map<String,String>>();
       Map<String, String> result1 = new HashMap<String, String>();
       result1.put("col1", "col1row1");
       result1.put("col2", "col2row1");
       result1.put("col3", "col3row1");
       results.add(result1);
       Map<String, String> result2 = new HashMap<String, String>();
       result2.put("col1", "col1row2");
       result2.put("col2", "col2row2");
       result2.put("col3", "col3row2");
       results.add(result2);
       Map<String, String> result3 = new HashMap<String, String>();
       result3.put("col1", "col1row3");
       result3.put("col2", "col2row3");
       result3.put("col3", "col3row3");
       results.add(result3);
       }
      
       public List<Map<String, String>> getResults() {
       return results;
       }
       public List<String> getColumnHeaders() {
       return columnHeaders;
       }
      }


      If I use Tomahawk's dataTable, it works fine. Any ideas why it's not working with RichFaces?
      Thanks for any insight!
      -Kris