Navigating through a Large RowSet

By Default, when database tables are dropped onto a page or a component like Table, it is configured to retrieve all rows on its execution. There are use cases where we don't want to be doing this, particularly, when table has thousands or millions of rows. In such cases, it would be good to set pagesize property appropriately, to limit the number of rows retrieved at a time.

This Sun Java Studio Creator 2 Sample Project available here demo's how to set up navigation through such large rowsets. It uses cachRowSet.nextPage() and crs.previousPage() to navigate through the rowsets.


screenshot - click to see full size

Note: When clicking NextPage button for the first time, it doesn't navigate to the next page.Whereas successive clicks on NextPage works fine. This is a known issue in the product.

Comments:

Hi Sakthi, What I don't like in this apporach is that you have to add the paging buttons manually. It's not the coding that bothers me, but that the looks are not consistent with datatables which have the automatic pagination buttons. Regards, Marcel

Posted by Marcel Overdijk on January 31, 2006 at 06:06 AM PST #

Hi, near is a workaround for the noted issue - "Note: When clicking NextPage button for the first time, it doesn't navigate to the next page.Whereas successive clicks on NextPage works fine. This is a known issue in the product."

Move tripDataProvider to the sessionBean1 and put this string to the prerender() method in the page.
public void prerender() {
...
getSessionBean1().getTripDataProvider().getRowCount();
...
}

Posted by Roman on June 01, 2006 at 09:19 PM PDT #

Post a Comment:
Comments are closed for this entry.
About

sakthi

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today