C H A P T E R 32 |
Dataset Locator |
The Dataset Locator component displays the record of the displayed data (e.g. Records 1 to 10 of 53).
The "to ##" portion will only be displayed if the page displays more than one record at a time.
The "of ##" portion will only be displayed if it can be calculated. Some models do not fully implement the PaginatingModel interface, in particular, the getTotalDataCount method, and therefore, this information is not available. Some models read the entire dataset into memory on each request, and therefore, the total is always available, even if the getTotalDataCount method is not implemented.
If a page is displayed with no records, the DatasetLocator will display "(No Data Found)" by default. This message can be customized by editing the JSP pagelet, "com/sun/jatox/view/DatasetLocator.jsp". This will happen in the event that a model does not implement the getTotalDataCount method, and the actual total data count is evenly divisible by the number of records displayed per page. On the last page of data of 50 total records with a 10 record per page display, the display will read "Records 41 to 50", and because the total data count is unknown, the Next and Last buttons will still be enabled. When the user clicks one of these buttons, a blank page will be displayed with the "(No Data Found)" display and the Next and Last buttons will disabled at this point.
Physcial layout of the DatasetLocator component on the page may determine whether it works or not. This is because of the sequence in which content is generated versus the actual execution of models in the application. For example, if you place the DatasetLocator before the fields that actually display the data, the model may not have been executed yet. If it has not, either move the DatasetLocator to follow the data display, or just execute the model manually before the DatasetLocator is displayed.
Copyright © 2004, Sun Microsystems, Inc. All Rights Reserved.