4 Replies Latest reply on Feb 6, 2008 5:03 AM by Anton

    Iterating columns in dataTable

    Anton Newbie

      I need to define a number of columns for dataTable in runtime.

      Nor "repeat" not c:forEach do not helps.

      How may it be done?

      And if no way, are there other component flexible enoth to sute my need?

      Or is it good idea to try to extend it?

        • 1. Re: Iterating columns in dataTable
          Ilya Shaikovsky Master

          you mean the panelGrid like component? then check rich:dataGrid example on demosite.

          Or you just need to set first few columns rendered and another just skipped? Then you can manage it via rendered attribute..

          • 2. Re: Iterating columns in dataTable
            Joern Newbie

            maybe my posting helps you a little bit:

            http://www.jboss.com/index.html?module=bb&op=viewtopic&t=129344

            i also had to define the number of columns at runtime

            • 3. Re: Iterating columns in dataTable
              Cle' Diggins Newbie

              You can bind the 'columns' parameter to a property in your bean. I have a similiar situation where I want there the be a column in a dataGrid for each entry in a list - so bound it to bean.list.size and it is working great.

              • 4. Re: Iterating columns in dataTable
                Anton Newbie

                2 Smilidon

                Thanks alot, now at least i see a way to do it. But have to check if it right.

                And then i check i will put +1 to your request.

                But, it looks like it is not the way the component designed to work. Maybe i am wrong.

                2 ilya_shaikovsky

                As i see rich:dataGrid is designed to show unified blocks in a grid.

                I have not a set of unified blocks, but rows and columns, defined runtime both.

                And i have no full (max) set of columns, they are added by user.

                I think i may stack all data to set or cells and then show using data grid, but it looks weird.

                I am ready to spend some time extending functionality of a component to my needs (and my manager too) and i will send you code to be included in next viersion, but i need some guidance on the way.

                If the way Smilidon chose is right one, may you tale us then a4j issue will be fixed in that case?

                PS Ilya are you speaking russian?