0 Replies Latest reply on Aug 13, 2007 2:13 AM by deep_edward

    Using dataTable inside tabs

    deep_edward

      Hi,
      I am using Tabs inside which i am displaying datatables.

      My requirement is to fetch data from the database table and each dataTable in the the Tab must display only one row from the database table, and the next row from the database table must be disaplayed in the next dataTable in the second tab an so on..i.e the number of rows in the database table, that many tabs must be created.(right now i am creating the tabs manually in jsf page, any suggestion for dynamic tab generation also welcome )

      Now,I am able to fetch the data from the Database layer,here I am making use of lists.

      The problem is in the jsf part where i am not able to display the data as required.
      I have clubbed three datatables inside one main datatable in each tab, as am fetching the data from three different datatables for each tab.
      Here, the first tab displays the data correctly but as I move the second tab, I am getting the details of tab one and two both(here tab one's data should not be displayed).



      <rich:tabPanel switchType="ajax" selectedTab="Tab1" tabClass="style9" >
      <rich:tab label="First">
      
      <h:form>
       <tr>
      
      <td><rich:dataTable id="ruleMastTable1"
       value="#{Data.rules}" var="mainList1" rows="1">
      
       <rich:column>
       <rich:dataTable value="#{mainList1.table1}"
       var="List1">
      
       <rich:column>
       <f:facet name="header">
       <h:outputText value="ABSCode" />
       </f:facet>
       <h:outputText value="#{List1.Code}">
       </h:outputText>
       </rich:column>
      
       .......
       </rich:dataTable>
      
       <rich:dataTable value="#{mainList1.table2}"
       var="List2">
      
       <rich:column>
       <f:facet name="header">
       <h:outputText value="PABCode" />
       </f:facet>
       <h:outputText value="#{List2.Code}">
       </h:outputText>
       </rich:column>
      
       ......
       </rich:dataTable>
      
       <rich:dataTable value="#{mainList1.table3}"
       var="List3">
      
       <rich:column>
       <f:facet name="header">
       <h:outputText value="KVBCode" />
       </f:facet>
       <h:outputText value="#{List3.Code}">
       </h:outputText>
       </rich:column>
      
       ......
       </rich:dataTable>
       </rich:column>
      </rich:dataTable>
      </rich:tab>
      
      <rich:tab label="Second">
      .....
      </rich:tab>
      
      .....
      
      </rich:tabPanel>



      I welcome all suggestions...
      Please let me know how to resolve this issue.

      Thanks in Advance
      Deep