6 Replies Latest reply on Sep 28, 2011 6:06 AM by henk de boer

    rich:columns in 4.1 Release

    Thomas Orgel Newbie

      Is there a change to see the rich:columns in the richfaces 4.1 Release

       

      Regards

      Thomas Orgel

        • 1. Re: rich:columns in 4.1 Release
          Ilya Shaikovsky Master

          Why you can't use c:forEach? Columns in RF 3.3.x was made just the same as that facelet JSTL tag.

          • 2. Re: rich:columns in 4.1 Release
            Thomas Orgel Newbie

            thanks for the tip.

             

            I have replaced my rich:columns tag with a c:foreach and rich:column and this works in richfaces 3.3.3.

            I hope this will also work in richfaces 4.

             

            regards

            Thomas Orgel

            • 3. Re: rich:columns in 4.1 Release
              mjsree Newbie

              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

              • 4. Re: rich:columns in 4.1 Release
                Ilya Shaikovsky Master

                you should use facelets c:forEach

                • 5. Re: rich:columns in 4.1 Release
                  mjsree Newbie

                  Hi IIya,

                   

                  below is the code. Should I need to use a different tag

                   

                   

                   

                   

                   

                   

                   

                   

                   

                   

                   

                  <

                   

                  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

                  >

                   

                   

                  • 6. Re: rich:columns in 4.1 Release
                    henk de boer Master

                    Ilya Shaikovsky wrote:

                     

                    Why you can't use c:forEach? Columns in RF 3.3.x was made just the same as that facelet JSTL tag.

                     

                    The problem is that c:forEach runs when the view is build and is then gone. Often you need columns to be created following an operation that took place in the "invoke application" phase. If you then try to build a table from the result of that operation, it won't work since "invoke application" happens after "restore view".

                     

                    Consider the following practical example:

                     

                      <rich:dataTable value="#{someBacking.someResult}" var="row">
                            
                          <c:forEach items="#{row}" var="column">  
                              <rich:column>
                                #{column}
                              </rich:column>  
                          </c:forEach>
                      
                      </rich:dataTable>
                    

                     

                    In this example, someResult would be e.g. a List<Object[]>, or a List<Map<String, Object>> or whatever. It's value is being set in an action method, so it will only be available after the "invoke application" phase.

                     

                    I think jstl wouldn't work here, would it?