3 Replies Latest reply on Aug 13, 2007 7:50 AM by Thiagu Mariappan

    How to create RichDataTable  with dynamic columns

    Thiagu Mariappan Novice

      Hai every one

      this is my user table structure

      
      id name age
      
      1 dev 35
      2 raj 14
      3 kavi 15
      
      I need to display the RichDataTable like this
      
      dev raj kavi
      
      1 2 3
      35 14 15
      
      


      It is possible in richface.
      i give the result List to dataTable, but i don't know how to make dynamic columns

      By
      Thiagu.m

        • 1. Re: How to create RichDataTable  with dynamic columns
          Igor Shabalov Apprentice

          You better use rich:dataGrid with specified number of columns. But you need to transform you model to somethin like

          dev
          raj
          kavi
          35
          14
          15

          and that use rich:dataGrid columns="3", it will produce

          dev raj kavi
          35 14 14

          etc.

          • 2. Re: How to create RichDataTable  with dynamic columns
            Thiagu Mariappan Novice

            Thank u for your replay ishabalov

            now i can able to display the value in column wise by using "rich:dataGrid"

            but it i need to display this information in a table format, i meant name, id, age will be displayed in a separate cells within single column

            but when i use "rich:dataGrid", i can't display this information in a separate row. All the information will be displayed in a single cell

            i give u my sample code here
            -

            <rich:dataGrid value="#{results}" var="user"
             id="grid" columns="#{results.size}">
             <h:outputText value="#{user.name}"/>
             <h:outputText value="#{user.id}"/>
             <h:outputText value="#{user.age}"/>
             </rich:dataGrid>
            
            


            the "results" is the ResultList of data form my session bean

            and i have one more query

            it is possible to data in a "subTable" format by using "rich:dataGrid"

            i meant

            
            ------------------------------------------
             Raj Kavi
            ------------------------------------------
            Personal TN AP
            Information -------------------------
             30000 10000
            -------------------------------------------
            Official India US
            Information ------------------------
             5 9
            -------------------------------------------
            


            Like this,

            i need to map the relevant information with those category
            it is possible by using "rich:dataGrid" component , this category information also from ResultList .

            By
            thiagu.m


            • 3. Re: How to create RichDataTable  with dynamic columns
              Thiagu Mariappan Novice

              RichFace have any component similar to t:columns (from MyFaces tomahawk lib)

              it supports columns iteration in the dataTable ,

              i think this component is resole my problem


              Thiagu.M