3 Replies Latest reply on Oct 22, 2007 7:07 AM by ilya_shaikovsky

    Tabs with similar content structure

    psk3344

      Hi,
      I am developing an application that uses rich tab panel with three tabs. The content in the three tabs are driven by the same datatable but different content based on the tab clicked i.e the columns are the same. So I put the datatable in a jsp (content.jsp) and included that in each tab. On Action event, i want to change the content and render the appropriate tab. The code is attached below.



      <rich:tabPanel>
      <rich:tab actionListener="#{backingbean.switchTab}">
      <jsp:include page="content.jsp" />
      </rich:tab>
      <rich:tab actionListener="#{backingbean.switchTab}">
      <jsp:include page="content.jsp" />
      </rich:tab>
      <rich:tab actionListener="#{backingbean.switchTab}">
      <jsp:include page="content.jsp" />
      </rich:tab>
      </rich:tabPanel>


      However, with this code I get a duplicate component error since the datatable is the same on all tabs.

      Am I doing this right? Can someone suggest me any alternatives if not? I would like to avoid code duplication, if possible, ie declaring the datatable thrice with different ids.

      Thanks,