2 Replies Latest reply on Jan 13, 2008 1:01 PM by David M. Karr

    tabpanel thinks two tabs have the same name

    David M. Karr Newbie

      JSF 1.1, RichFaces 3.1.3.

      Before I file a bug report on this, I'll post this here in case I'm doing something obviously wrong.

      I have a simple tabpanel with skeleton code in each tab. Each tab has a "name" attribute with a different value. When I try to render it, I get this exception:

      javax.faces.FacesException: tabs with the same name not allowed
       at org.richfaces.renderkit.TabPanelRendererBase.encodeTabs(TabPanelRendererBase.java:328)
       at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeBegin(TabPanelRenderer.java:227)
       at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeBegin(TabPanelRenderer.java:180)
       at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:101)
       at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)
       at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:591)
       at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:543)

      I stepped through this code in the debugger. My example has three tabs, with the names "obligor", "property", and "ratings". When it stepped through them, it saw the first one as "obligor", the second one as "property", and the third one as "property" (not "ratings").

      Here's my page in its current state:
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <html>
      <head>
      <title>TabPanel Experiment</title>
      </head>
      <body>
      <f:view>
       <a4j:form>
       <rich:tabPanel id="tabpanel" switchType="client">
       <rich:tab name="obligor" label="Obligor">
       <h:panelGrid columns="2" id="obligorFields">
       <h:outputText>Field1</h:outputText>
       <h:inputText id="field1"/>
       </h:panelGrid>
       </rich:tab>
       <rich:tab name="property" label="Property">
       <h:panelGrid columns="2" id="propertyFields">
       <h:outputText>Field2:</h:outputText>
       <h:inputText id="field2"/>
       </h:panelGrid>
       </rich:tab>
       <rich:tab name="ratings" label="Ratings">
       <h:panelGrid columns="2" id="ratingsFields">
       <h:outputText>Field3:</h:outputText>
       <h:inputText id="field3"/>
       </h:panelGrid>
       </rich:tab>
       </rich:tabPanel>
       </a4j:form>
      </f:view>
      </body>
      </html>