1 Reply Latest reply on Jul 2, 2010 6:06 AM by Mister Face

    rich:tabPanel with dynamically listed tabs

    Mister Face Newbie



      I'm using JSF1.2, Richfaces3.3.3, Tomcat6. I try to have a rich:tabpanel with dynamically listed tabs usng <c:forEach> tag:



      <?xml version="1.0" encoding="ISO-8859-1" ?>
      <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"
          <jsp:directive.page contentType="text/html;charset=ISO-8859-1"
              pageEncoding="ISO-8859-1" session="false" />
          <jsp:output doctype-public="-//W3C//DTD XHTML 1.1//EN"
              doctype-root-element="html" omit-xml-declaration="false" />
                <title><h:outputText value="#{msg_bundle.website_title}"/></title>
              <center><h:form id="main">
                  <a4j:outputPanel id="tabWrapper">
                      <rich:tabPanel id="panel_tab" height="500" width="980" >
                          <rich:tab id="mainoverview">
                               <f:facet name="label">
                                      <h:outputText value="Overview" />
                               <h:outputText value="text text tex text" />
                               <!-- some content -->
                          <c:forEach items="#{dynamicTab.tabs" var="tab" begin="1">
                              <rich:tab name="tab_#{tab.id}" rendered="true" >
                                 <f:facet name="label">
                                          <h:outputText value="#{tab.aktenzeichen}" />
                                  <h:outputText value="Bericht #{tab.aktenzeichen}" />



      <c:forEach> just doesn't print any output. When I remove begin="1" in this Tag I get exactly one added tab without any label or content.

      I tried to use <a4j:repeat> and <ui:repeat> as well, but as everybody on the internet says, it's just not compatible with <rich:tabpanel>


      Here's my Session Bean and a Model:



      public class DynamicTab {
          private List<CustomTab> tabs;
          int i=1;
          public DynamicTab() {
              tabs= new ArrayList<CustomTab>();
              tabs.add(new CustomTab(i++,"test"));
          public List<CustomTab> getTabs() {
              return tabs;
      public class CustomTab {
          private int id;
          private String aktenzeichen;
          public CustomTab() {
              // TODO Auto-generated constructor stub
          public CustomTab(int id, String aktenzeichen) {
              this.id= id;
              this.aktenzeichen= aktenzeichen;
          public int getId() {
              return id;
          public void setId(int id) {
              this.id = id;
          public String getAktenzeichen() {
              return aktenzeichen;
          public void setAktenzeichen(String aktenzeichen) {
              this.aktenzeichen = aktenzeichen;



      I can list the content of my tab list within a panel with a4j:reapeat and in the console. so there is data.

      Any ideas why - the f*** - there is no output or error message?