-
1. Re: can you feed data to table 1 page at a time instead of w
sergeysmirnov Apr 18, 2007 7:33 PM (in response to vh)Could you explain what do you want in little bit more details, please.
-
2. Re: can you feed data to table 1 page at a time instead of w
alexanderbelov Apr 19, 2007 1:14 AM (in response to vh)I have the same problem. I don't want to pass all data in table. I want to know, what page is chosen by client. When I pass requested data to table.
The problem is in size of data. Very othen client needs to take only first pages. It's not nessesary to pass all data from database to table. I want to say to table how many data have I. And pass it by blocks. -
3. Re: can you feed data to table 1 page at a time instead of w
vh Apr 19, 2007 1:21 PM (in response to vh)yes. AlexanderBelov described my problem. Say I have totally 200 pages, I want the table to know that I have 200 pages (so it can show 1 of 200 correctly), but when user navigate to the 1st page, I only give the table the data to show the first page; when user navigates to the second page, I only give the table enough data to show the second page. etc
-
4. Re: can you feed data to table 1 page at a time instead of w
ishabalov Apr 19, 2007 7:00 PM (in response to vh)That problem can be solved in many ways. For example ypu can use following approach:
Use special implementation of DataModel that can fetch rows from database in "controllable" fashion. It must provide correct row count, for example using separate request "select count(*)..." and than be able to fetch rows in batches based on row index. Normally you need to provide filtering/sorting parameters to your data model.
Specifics how to fetch given number of rows depends from your usecase. For example if you use Hibernate you may use setFirstRow() setNumberOfRows() methods on Query. -
5. Re: can you feed data to table 1 page at a time instead of w
alexanderbelov Apr 20, 2007 12:12 AM (in response to vh)Yes, I use custom component, writen by me. I simple wanted to know if this feature is planned to next version of dataTable of RichFaces.
-
6. Re: can you feed data to table 1 page at a time instead of w
vh May 3, 2007 4:28 PM (in response to vh)Does anyone have sample code?
-
7. Re: can you feed data to table 1 page at a time instead of w
vh May 3, 2007 4:39 PM (in response to vh)Does it mean I can bind a javax.faces.model.DataModel to the "value" attribute of <rich:dataTable> and provide my own DateModel to do the work?
-
8. Re: can you feed data to table 1 page at a time instead of w
vh May 3, 2007 5:03 PM (in response to vh)Also, each time I fetch a page of date (say row 10-20 out of 100), I need to know the current sorting info (on which column, which order). How does my DataModel know that?