2 Replies Latest reply on Sep 26, 2011 2:40 PM by mjsree

    rich:column with c:forEach

    mjsree

      Hi,

       

        I am trying to implement rich:column with c:forEach to generate dynamic datatable. But c:forEach is not iterating through the list and nothing is diplayed on screen.

       

      Is there any version constraint to use c:forEach with rich:column? We are using JSF1.1, richfaces 3.1.4 and java 1.4.

       

      Any help would be appreciated.

       

      Jayasree

        • 1. Re: rich:column with c:forEach
          mp911de

          Hi,

          can you post some code? You can also take a look on http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_columns.html, there is a sample.

           

          Best regards,

          Mark

          • 2. Re: rich:column with c:forEach
            mjsree

            Hi Mark,

             

            below is the same code that I am trying..

             

            <

             

            rich:dataTable value="#{Test.rows}" var="r"

            >

             

             

             

             

            <c:forEach items="#{Test.columns}" var="c" varStatus="i"

            >

             

             

            <rich:column

            >

             

             

            <f:facet name="header"

            >

             

             

            <h:outputText id="test1" value="#{c}"

            />

             

             

            </f:facet

            >

             

             

            <h:outputText id="test2" value="#{r[i.index]}"

            />

             

             

            </rich:column

            >

            </

             

            c:forEach

            >

             

             

            </rich:dataTable

            >

             

            ### bean class

             

             

             

             

             

             

             

             

             

             

             

             

             

             

             

             

             

             

             

             

             

             

             

            public

             

            List getColumns () {

             

             

            columns = new

            ArrayList();

            AddressBean add =

            null

            ;

             

            System.

            out.println("in Columns------------"

            );

             

            for(int

            i=0;i<4;i++){

             

            add =

            new

            AddressBean();

             

            add.setCity(

            "city"

            );

             

             

            }

             

             

             

            columns.add("col1"

            );

             

            columns.add("col2"

            );

             

            columns.add("col3"

            );

             

             

            return columns

            ;

             

             

            }

             

            public

             

            List getRows() {

             

             

            rows = new

            ArrayList();

            System.

            out.println("in Rows------------"

            );

             

            rows.add("row1"

            );

             

            rows.add("row2"

            );

             

            rows.add("row3"

            );

             

            rows.add("row4"

            );

             

             

            return rows

            ;

             

             

             

            }

             

            Please let me know if anything wrong.