4 Replies Latest reply on Jun 24, 2009 11:08 AM by ilya_shaikovsky

    rich:dataTable: How to set default sorting?

      Hi all,

      I'm working with rich:dataTable and don't know how to set the default sorting order for it. Does someone know a way to do it?

      Thanks,

        • 1. Re: rich:dataTable: How to set default sorting?

          Is there anyone with experience about this problem?

          • 2. Re: rich:dataTable: How to set default sorting?
            ilya_shaikovsky

            sortOrder and sortPriority attributes could be used. check livedemo. it not defined initially there but you could define.

            • 3. Re: rich:dataTable: How to set default sorting?

               

              "ilya_shaikovsky" wrote:
              sortOrder and sortPriority attributes could be used. check livedemo. it not defined initially there but you could define.


              Hi Shaikovsky,

              Thanks for your answer! However, I've tried many ways to do it but all without success :-(. In my application, I need to do the paging and sorting on db side and that's why I chose the ExtendedDataModel as basis. All work well for me except the default sorting indicator. I could not set the indicator to reflect the initial sorting order although the data was sorted correctly. If I use the sortOrder attribute to self-define the sort orders for each rich:column, then another problem happened ===> The sort was not submitted back to server as my data model (which implements interface Modifiable) 's method modify() was not called as expected.

              Can you give me a small example for this usecase?

              Thanks a lot,

              • 4. Re: rich:dataTable: How to set default sorting?
                ilya_shaikovsky

                could ask ask you about simple sample in war with Java sources and mock data in order to examine it live? It will be easilly for me to investigate code locally and post the answer here.