- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml
Classes:
TInvalidPropertyException
TLazyLoadList
TObjectProxy
TPropertyAccess
TSqlMapApplicationCache
TSqlMapCache
TSqlMapConfig
TSqlMapConfigurationException
TSqlMapDuplicateException
TSqlMapException
TSqlMapExecutionException
TSqlMapFifoCache
TSqlMapGateway
TSqlMapLruCache
TSqlMapManager
TSqlMapPagedList
TSqlMapTypeHandler
TSqlMapTypeHandlerRegistry
TSqlMapUndefinedException

Keyword

# Class TSqlMapPagedList

    TComponent
       |
       --TList
          |
          --TPagedList
             |
             --TSqlMapPagedList

TSqlMapPagedList implements a list with paging functionality that retrieves data from a SqlMap statement.

The maximum number of records fetched is 3 times the page size. It fetches the current, the previous and the next page at a time. This allows the paged list to determine if the page is a the begin, the middle or the end of the list.

The paged list does not need to know about the total number of records.

Since: 3.1
Author: Wei Zhuo <weizhuo[at]gmail[dot]com>

Constructor Summary
public | __construct Array Create a new SqlMap paged list.

Method Summary
protected void | fetchDataFromStatement ( TPageList $sender, TPagedListFetchDataEventParameter $param) Fetch data by executing the SqlMap statement.
boolean | getIsLastPage ()
boolean | getIsMiddlePage ()
boolean | getIsNextPageAvailable ()
boolean | getIsPreviousPageAvailable ()
protected array | getOffsetAndLimit ( TPagedListFetchDataEventParameter $param) Calculate the data fetch offsets and limits.
protected void | initialize ( IMappedStatement $statement, mixed $parameter, int $pageSize, int $page) Initialize the paged list.
integer|boolean | nextPage () Switches to the next page.
protected void | populateData ( TPagedListFetchDataEventParameter $param, array $data) Populate the list with the fetched data.
integer|boolean | previousPage () Switches to the previous page.
void | setCustomPaging ( mixed $value)

Methods Inherited From TPagedList

TPagedList::getCount(), TPagedList::getCurrentPageIndex(), TPagedList::getCustomPaging(), TPagedList::getIsFirstPage(), TPagedList::getIsLastPage(), TPagedList::getIterator(), TPagedList::getPageCount(), TPagedList::getPageSize(), TPagedList::getVirtualCount(), TPagedList::gotoPage(), TPagedList::indexOf(), TPagedList::itemAt(), TPagedList::nextPage(), TPagedList::offsetExists(), TPagedList::offsetGet(), TPagedList::onFetchData(), TPagedList::onPageIndexChanged(), TPagedList::previousPage(), TPagedList::setCurrentPageIndex(), TPagedList::setCustomPaging(), TPagedList::setPageSize(), TPagedList::setVirtualCount(), TPagedList::toArray()

Methods Inherited From TList
TList::add(), TList::clear(), TList::contains(), TList::copyFrom(), TList::count(), TList::getCount(), TList::getIterator(), TList::getReadOnly(), TList::indexOf(), TList::insertAt(), TList::itemAt(), TList::mergeWith(), TList::offsetExists(), TList::offsetGet(), TList::offsetSet(), TList::offsetUnset(), TList::remove(), TList::removeAt(), TList::setReadOnly(), TList::toArray()

Methods Inherited From TComponent

TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()

Constructor Details

## __construct

public __construct | Array

Create a new SqlMap paged list.

Method Details

## fetchDataFromStatement

protected void fetchDataFromStatement | (TPageList $sender , TPagedListFetchDataEventParameter $param )

Fetch data by executing the SqlMap statement.

Input
TPageList | $sender | current object.
TPagedListFetchDataEventParameter | $param | fetch parameters
Output
Exception

## getIsLastPage

public boolean getIsLastPage | ()

Output
boolean | true if is the very last page, false otherwise.
Exception

## getIsMiddlePage

public boolean getIsMiddlePage | ()

Output
boolean | true if is not first nor last page, false otherwise.
Exception

## getIsNextPageAvailable

public boolean getIsNextPageAvailable | ()

Output
boolean | true if the next page is available, false otherwise.
Exception

## getIsPreviousPageAvailable

public boolean getIsPreviousPageAvailable | ()

Output
boolean | true if the previous page is available, false otherwise.
Exception

## getOffsetAndLimit

protected array getOffsetAndLimit | (TPagedListFetchDataEventParameter $param )

Calculate the data fetch offsets and limits.

Input
TPagedListFetchDataEventParameter | $param | fetch parameters
Output
array | 1st element is the offset, 2nd element is the limit.
Exception

## initialize

protected void initialize | (IMappedStatement $statement , mixed $parameter , int $pageSize , int $page )

Initialize the paged list.

Input
IMappedStatement | $statement | SqlMap statement.
mixed | $parameter | query parameters
int | $pageSize | page size.
int | $page | number of page.
Output
Exception

## nextPage

public integer|boolean nextPage | ()

Switches to the next page.

Output
integer|boolean | the new page index, false if next page is not availabe.
Exception

## populateData

protected void populateData | (TPagedListFetchDataEventParameter $param , array $data )

Populate the list with the fetched data.

Input
TPagedListFetchDataEventParameter | $param | fetch parameters
array | $data | fetched data.
Output
Exception

## previousPage

public integer|boolean previousPage | ()

Switches to the previous page.

Output
integer|boolean | the new page index, false if previous page is not availabe.
Exception

## setCustomPaging

public void setCustomPaging | (mixed $value )

Input
mixed | $value |
Output
Exception
throws | TSqlMapException custom paging must be enabled.