9 Replies Latest reply on Jul 3, 2008 5:08 PM by Julien Chouinard

    sort table help

    Alberto Torres Newbie

      Hello,


      I´m using richfaces 3.2.1, with seam 2.0
      and when i try to use sorttables doesn´t apear anything.


      Maybe I need to update js-facets jar??


      I dont´n know what I need


      Thanks


      Example



                                             
      rich:column sortBy p.codigo

        • 1. Re: sort table help
          Guillaume Jeudy Master

          You did not explain clearly what is the problem.


          Try checking Richfaces demo its a good starting point, go in Data Iteration - Table Sorting section.


          You can also check out Richfaces Dev Guide.

          • 2. Re: sort table help
            Alberto Torres Newbie

            What I said is that when I insert sort atributes as in richfaces demo inside a rich datatable,


            It does not work becouse it looks as allways,with nothing new, no sort click appear.


            And I try a lot of times to make it works but i can not.


            Thanks

            • 3. Re: sort table help
              Mike K Newbie

              Well no xhtml code so I'll just post a working example:


              The trick is sortBy with hash and brackets.


              <rich:dataTable value="#{bean.sortData}" var="data" width="300px" columnClasses="center" rows="10">
                          <f:facet name="header">
                              <h:outputText value="Sorting Example"/>
                          </f:facet>
                          <rich:column>
                              <f:facet name="header">
                                  <h:outputText value="ID"/>
                              </f:facet>
                              <h:outputText value="#{data.id}"/> 
                          </rich:column>
                          <rich:column sortBy="#{data.foo}"> 
                              <f:facet name="header">
                                  <h:outputText value="Foo"/>
                              </f:facet>
                              <h:outputText value="#{data.foo}"/>
                          </rich:column> 
                          <rich:column sortBy="#{data.bar}">
                              <f:facet name="header">
                                  <h:outputText value="Bar"/>
                              </f:facet>
                              <h:outputText value="#{data.bar}"/> 
                          </rich:column>
                      </rich:dataTable>
              



              CU Mike

              • 4. Re: sort table help
                Alberto Torres Newbie

                Hello Mike,


                Yes, this is what a try, and I have tried more options that i have found on the internet, but it doesn´t work, nothing new appear for sort the table.


                Thanks

                • 5. Re: sort table help
                  Mikael Andersson Master

                  In which scope is your backing bean, it isn't event/request scope is it?


                  micke

                  • 6. Re: sort table help
                    Alberto Torres Newbie

                    Hello,


                    My backing bean is session scope.


                    do you know how to view the properties on my api jar?


                    thanks a lot,

                    • 7. Re: sort table help
                      Mikael Andersson Master

                      Hi


                      Session socpe is fine.


                      What propeties do you want to view?


                      I think you need to post the xhtml and java code, I have no idea why it doesn't sort for you. The sorting just works for me.


                      The only other thing I can think of is validation error perhaps, do you have a rich:messages in the page?


                      Are you absolutely sure the 3.2.1 version of RichFaces is used, no other old version on the classpath (should be logging when it loads taglibs which includes version number)?


                      Good luck,


                      Micke

                      • 8. Re: sort table help
                        Przemysław Wojewódka Newbie

                        I came accross the same problem... Need I do anyhing except things in your file Mike? Because my file is similar to yours and still without clickable column name. Is clickable column name created by default when sortBy is used on column?


                        Thanks in advance

                        • 9. Re: sort table help
                          Julien Chouinard Newbie

                          I had the same problem, just updated to the last RichFaces and then it was allright. So make sure your libs are from the right version.