2 Replies Latest reply on May 5, 2010 4:00 AM by nille m

    rich:dataTable, column id missing results in duplicate Id

    nille m Newbie

      Hi everyone,

       

      before I start to describe my problem: I did some research and found a similar issue (https://jira.jboss.org/jira/browse/RF-4598?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel) which is fixed in RF 3.3.1. But because there are not much details in the bug description I'm not able to verify if that issue is the same as mine.

       

      The problem occurs only randomly so I cannot reproduce it. It occurs in a test environment with a few dozen users.

       

      The exception is:

       

      SEVERE: Error Rendering View[/report/costs.xhtml]
      java.lang.IllegalStateException: duplicate Id for a component myForm:Maintable_1:Subtable_1:id_3
      at org.ajax4jsf.application.TreeStructureNode.apply(TreeStructureNode.java:50)
      ...

       

      What me strucks here is that there is missing one more digit between 'Subtable_1' and 'id_3'. But first the xhtml page wich generates the table:

       

       

      <ui:composition style="background-color:#666666"
       ...
       xmlns:rich="http://richfaces.org/rich">
       
      <rich:dataTable value="#{listWithNumberOfSubtables}" var="listHeaders" id="#{tableId}">
           <rich:columns value="#{myTable.columns}" var="columns" index="myIndex">
                <f:facet name="header">
                     <s:div style="text-align:center;">
                          <h:outputText value="#{columns.headline}" escape="false"/>
                     </s:div>
                </f:facet>
                <h:outputText value="#{columns.subHeadline}"/>
           </rich:columns>
           <f:facet name="footer">
                <rich:subTable value="#{myTable.descriptions}" var="subTableRow" border="0" id="#{subTableID}" ajaxKeys="#{rowsToUpdate}" rowKeyVar="currentRowIndex">
                     <rich:column>
                          <h:outputText value="#{subTableRow.description}" escape="false"/>
                     </rich:column>
                     <rich:columns value="#{myTable.getArrayWithFields(currentRowIndex)}" var="field" index ="ind3">
                          <h:inputText style="text-align:right;" value="#{field.fieldValue}" id="#{field.identifier}">
                     </rich:columns>
                </rich:subTable>
           </f:facet>
      </rich:dataTable>
      
      </ui:composition>
      

       

      This is included by the 'costs.xhtml'. If I browse the generated HTML code a typical ID of an input field looks like:

       

      myForm:Maintable_1:Subtable_1:0:id_3 (in opposite to the generated id in the exception: myForm:Maintable_1:Subtable_1:id_3)

      The bold printed :0: depends on the current row in the array returned by '#{myTable.getArrayWithFields(currentRowIndex)}'. So, that's fine and exactly what I expected.

       

      But how is it possible that a ID like the one within the exception (myForm:Maintable_1:Subtable_1:id_3) is generated? If '#{myTable.getArrayWithFields(currentRowIndex)}' would be empty no row would be rendered (and therefore no id 'id_3'). How can the index of the array / row can get lost?

       

      I think the biggest problem is, that it's (for me) not reproduceable. Does anybody has any idea?

       

      We are using:
      RF 3.2.2
      Seam 2.1.2
      JSF: Sun RI, 1.2_13-b01-FCS

       

      If my problem is the same as the one in the above mention jira entry: sorry for generating more 'noise'.


      Thanks a log in advance,

       

      Kind Regards