2 Replies Latest reply on Apr 3, 2007 9:15 AM by Thai Dang Vu

    Data Table Scroller Features: External Sorting

    Thai Dang Vu Apprentice

      Is there any feature to sort the data (by columns) in a data table scroller? I'd like to display my data like in display tag.

      I'd like to have another attribute for the <rich:dataTable> tag (e.g. we can name that attribute `from'). The reason I need another attribute is:

      Suppose that your data contains a lot of records (tens of thousand records) and it's impossible for you to fetch them all from the database (because it takes a lot of time) and then put them in the `value' attribute of the rich:dataTable tag. So I wish I can tell rich:dataTable that these 300 records of me in the total of 50k records contains the records starting from the #21 and I want to display page 6. After some calculations, <rich:dataTable> knows that page 6 will contains records from #101 to #120 in the whole 50k records and the records from #101 to #120 in the whole 50k records are the ones from #81 to #100 in the 300 records that I gave <rich:dataTable> in the `value' attribute. Then rich:dataTable have the right data to display.

      About external sorting, when a column header is clicked, rich:dataTable should call some method where I can get the data from a sql statement like "select ... from ... order by ..." (I don't want to sort the Java objects that I gave rich:dataTable in the `value' attribute because it will be much slower than letting the database do the sort if we have a lot of data) and give it to rich:dataTable.

      I don't know if I express my idea clear enough so that you understand what I mean. Therefore, if there's any place unclear, please let me know and I'll revise this post.