2 Replies Latest reply on Apr 7, 2011 10:46 AM by James Johnson

    Dynamic tabPanel - tabs with the same name not allowed

    James Johnson Newbie

      I am trying to create a dynamic tabPanel using s:forEach.  This works as long as I specify switchType="client".  However, if I specify ajax or server the page initially renders correctly, but if I select a different tab, I recieve an exception of "tabs with the same name not allowed."

       

      Any suggestions on how to correct this or alternate approaches are greatly appreciated.

       

      Here is my view:

      <a:outputPanel id="genericOutput">
        <rich:tabPanel
         id="genericTabPanel" switchType="ajax">
         <c:forEach items="#{genericTabList}" var="tab">
          <rich:tab label="#{tab.name}" id="#{tab.name}" name="#{tab.name}">
           <ui:include src="#{tab.viewId}" />
          </rich:tab>
         </c:forEach>

        </rich:tabPanel>
      </a:outputPanel>

       

      And from the class where genericTabList is outjected:

       

      @Out(scope=ScopeType.CONVERSATION)

      ArrayList<Tab> genericTabList = new ArrayList<Tab>();

       

      public void init()

      {

        genericTabList.add(new Tab("Doctor", "/test.xhtml"));

        genericTabList.add(new Tab("Events", "/Comments/reqEvtCommentList.xhtml"));

       

       

        genericTabList.add(new Tab("Memos", "/Memos/history.xhtml"));

      }

      Finally the stack trace:

       

      16:47:36,298 ERROR [viewhandler] Error Rendering View[/Application/Requirements/requirementDetail.xhtml]

      javax.faces.FacesException: tabs with the same name not allowed

      at org.richfaces.renderkit.TabPanelRendererBase.encodeTabs(TabPanelRendererBase.java:356)

      at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeBegin(TabPanelRenderer.java:228)

      at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeBegin(TabPanelRenderer.java:180)

      at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:100)

      at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:275)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:78)

      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:279)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:279)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:279)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:279)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:200)

      at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:195)

      at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)

      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)

      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)

      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)

      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)

      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)

      at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)

      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)

      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)

      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)

      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)

      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

      at org.jboss.web.tomcat.service.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:135)

      at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:94)

      at org.jboss.web.tomcat.service.session.LockingValve.invoke(LockingValve.java:62)

      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)

      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

      at java.lang.Thread.run(Unknown Source)

      16:47:36,300 SEVERE [lifecycle] JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /Application/Requirements/requirementDetail.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@7d957060]

      16:47:36,304 ERROR [Exceptions] handled and logged exception

      javax.servlet.ServletException: tabs with the same name not allowed

      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)

      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

      at org.jboss.web.tomcat.service.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:135)

      at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:94)

      at org.jboss.web.tomcat.service.session.LockingValve.invoke(LockingValve.java:62)

      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)

      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

      at java.lang.Thread.run(Unknown Source)

      Caused by: javax.faces.FacesException: tabs with the same name not allowed

      at org.richfaces.renderkit.TabPanelRendererBase.encodeTabs(TabPanelRendererBase.java:356)

      at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeBegin(TabPanelRenderer.java:228)

      at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeBegin(TabPanelRenderer.java:180)

      at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:100)

      at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:275)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:78)

      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:279)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:279)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:279)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:279)

      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

      at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:200)

      at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:195)

      at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)

      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)

      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)

      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)

      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)

      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)

      at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)

      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)

      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)

      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)

      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)

      ... 46 more