1 Reply Latest reply on Feb 26, 2009 11:22 AM by Nick Belaevski

    Optimizing code for datatable - Please advise

    E Aish Novice


      We retrieve the back end data and return as a list to the DataTable / scrollableData Table component to display them in table format. We use the following command set to display each column in that table.

      <rich:column id="column1">
      <f:facet name="header" id="Column1_Header">
      <h:outputText value="Column1_Header" />
      <h:outputText value="#{returnList.Column1_Value}" />

      We repeat the above for each column in that table. Also, if we are displaying different tables in different web pages, we repeat the same set of commands in each programs.

      Rather, if the return list has the no. of columns (say N columns)and the resultset from the database, and the front end code read the list and determine the no. of columns contained in that resultset, then we can use the one code set to reiterate the N no. of times to display each column in that resultset.

      Can you please let me know the way to achive this.