12 Replies Latest reply on Nov 4, 2012 10:08 PM by snjv180

    dataTable in 4.x: a4j:repeat or rich:columns

    ilya_shaikovsky

      Some time ago a few discussion taken place about dynamic columns generation.

       

      We had two options for that:

      • improve a4j:repeat to support such cases
      <rich:table ...>
           <a4j:repeat ...>
                <rich:column>
                     <h:output .../>
                </rich:column>
           </a4j:repeat>
      </rich:table>
      
      
      
      • create separate rich:columns component(as in 3.3.x)

       

      <rich:table ...>
      <rich:columns ...>
                <h:output.../>
      </rich:columns>
      </rich:table>
      
      
      
      
      

       

       

      Now we need to return to this topic. And questions list

      • which changes required to a4j:repeat and how will this change this base component functionality?
      • if we will decide to improve the repeat in this way do we be able to use it for others components (dynamic menus, bars and so on)?
      • etc...?

       

      I think we should not go with both approaches but need to decide which one to use.

        • 1. Re: dataTable in 4.x: a4j:repeat or rich:columns
          nbelaevski
          For the first option we need to "improve" rich:dataTable so that it will use visit() method and not getChildren(). I think it's time to start supporting this for all of our components.
          • 2. Re: dataTable in 4.x: a4j:repeat or rich:columns
            jbalunas

            I would like to hear more about this idea?  Would this let nearly everything be "repeatable" with a4j:repeat?  How would this effect other functionality?

             

            Also regarding the rich:columns - the nice thing about them is that they are easy to understand, and people get the concept easily.  I'm not saying that using a4j:repeat is not the right thing to do, but ease of use and learning curve is important too.

             

            -Jay

            • 3. Re: dataTable in 4.x: a4j:repeat or rich:columns
              ilya_shaikovsky
              Also regarding the rich:columns - the nice thing about them is that they are easy to understand, and people get the concept easily.  I'm not saying that using a4j:repeat is not the right thing to do, but ease of use and learning curve is important too.

              Repeat usage is intuitive solution for users. Before we made columns in 3.x - peoples which tried to create dynamic columns always started with repeat and column inside. And only when we explained again and again at forums that it can't be implemented with repeat and c:forEach should be used - they continue with that. Also guys reepatedly asking till nowadays about creating tabs and panelMenus dynamically and the first thing they trying - repeat usage. So I think #1 is more preferable. The only thing I doubt - influence on the base functionality. Thats why created thread for review

              • 4. Re: dataTable in 4.x: a4j:repeat or rich:columns
                jbalunas
                Fair comments and feedback.  Lets stick with a4j:repeat approach and discuss more about the generic support for dynamic creation of components like what Nick was talking about.
                • 5. Re: dataTable in 4.x: a4j:repeat or rich:columns
                  enriquezrene_ap

                  Hi

                  I'm using RF 3.3.3, I have the next snnipet:

                   

                  <rich:dataTable  value="#{backingbean.list}" var="item" width="100%">

                                         

                                          <rich:column>

                                              <f:facet name="header">Name</f:facet>

                                              <h:outputText

                                                  value="#{item.name}" />

                                          </rich:column>

                                         

                                          <c:forEach items="#{item.months}" var="month">

                                              <rich:column>

                                                  <f:facet name="header">

                                                      <h:outputText value="#{month.name}" />

                                                  </f:facet>

                                                  <h:outputText value="#{month.mount}" />

                                              </rich:column>

                                          </c:forEach>

                   

                  </rich:dataTable>

                   

                  I need generate rich:columns from months dinamically but I can't make, please help me

                  • 6. Re: dataTable in 4.x: a4j:repeat or rich:columns
                    mtranchant

                    Any update on this topic ?

                    It seems to be something some people do need (I am one of them)...

                    • 7. Re: dataTable in 4.x: a4j:repeat or rich:columns
                      bleathem

                      @mtranchant we discussed this recently in our team meeting:

                      https://community.jboss.org/wiki/RichFacesTeamMeetingAgenda2012-05-15#comment-9875

                       

                      The idea is not forgotten, and should be addrssed in the 4.3 timeframe.

                      • 8. Re: dataTable in 4.x: a4j:repeat or rich:columns
                        mtranchant

                        Thanks for keeping me informed.

                         

                        Regards

                        • 9. Re: dataTable in 4.x: a4j:repeat or rich:columns
                          snjv180

                          Could I get a alternative for using rich:columns. I need this component. I do not want to work with c:foreach because it will just not run. Possbily because or partial state saving and viewscoped beans. What can I do for now. Any suggestions would be very helpful. Why can't I just use a4j:repeat and loop over rich:column that must have worked I think. Anyother ideas??? or do I just have to keep waiting. Please suggest. Thank you!!!

                          • 10. Re: dataTable in 4.x: a4j:repeat or rich:columns
                            javatwo

                            W need dynamic columns too. Is the first approach <a4j:repeat> in 4.2.3?

                            thanks for info.

                            Dave

                            • 11. Re: dataTable in 4.x: a4j:repeat or rich:columns
                              javatwo

                              <a4j:repeat> for all other components is great. We do not want list them all in jsf page, like tabPanel, actually we can not because backing data is dynamic. Thanks.

                              • 12. Re: dataTable in 4.x: a4j:repeat or rich:columns
                                snjv180

                                It is said that they are going to implement it in Richfaces 5. For now using the c:foreach is the only option we have got. I hope they can do it soon.