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.


Property Name

Description

Notes

Show Dataset Total

Displays the absolute total number of records in the dataset (last record index number). This will only work for model types that have properly implemented the getTotalDataSize method from the PaginatingModel interface, or the total number of records can be deterministally calculated. If the total number of records can not be determined, then the total records portion of this control will not display, as if the property were set to false.

 

Name

The class name of the component.

 

Target Container View Path

The name of the ContainerView reference instance as declared in its parent (a ContainerView, TiledView, or ViewBean).

This name may be a qualified view path, using forward slashes ("/") as delimiters. All components in the path must refer to a ContainerView or a derivative of ContainerView (such as TiledView, ContainerView, or ViewBean or other custom or third party version derivative of these types). Both relative and absolute paths are possible. If a name path begins with a forward slash, the name is assumed to be relative to the root view (the ViewBean). If the path does not begin with a forward slash, the name is assumed to refer to a child relative to the current container. Two dots ("..") may be used to refer to the container that is the parent of the current container.

Examples:

/ (target the same container view that is also the parent of this component)

/header/orderList/customerName (absolute from root view)

orderList/customerName (relative to current container)

../footer/orderList/customerName (relative to parent)