Class AbstractPageableView<T>

Type Parameters:
T - row/item model object type
All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IHeaderContributor, IPageable, IRequestableComponent, IHierarchical<Component>, IClusterable

public abstract class AbstractPageableView<T> extends RefreshingView<T> implements IPageable
Wicket AbstractPageableView alternative that uses IDataSource as data source. Compared to Wicket AbstractPageableView this component allows paging without knowing the total number of rows.
Author:
Matej Knopp
See Also:
  • Field Details

    • UNKNOWN_COUNT

      public static final long UNKNOWN_COUNT
      Constant for unknown count of rows.
      See Also:
  • Constructor Details

    • AbstractPageableView

      public AbstractPageableView(String id, IModel<T> model)
      Constructor,
      Parameters:
      id -
      model -
    • AbstractPageableView

      public AbstractPageableView(String id)
      Constructor.
      Parameters:
      id -
  • Method Details

    • getTotalRowCount

      public long getTotalRowCount()
      Returns the total count of items (sum of count of items on all pages) or UNKNOWN_COUNT in case the count can't be determined.
      Returns:
      total count of items or -1L
    • getCurrentPageItemCount

      public int getCurrentPageItemCount()
      Returns the count of items on current page.
      Returns:
      count of items on current page
    • getCurrentPage

      public long getCurrentPage()
      Specified by:
      getCurrentPage in interface IPageable
      Returns:
      The current page that is or will be rendered.
    • onBeforeRender

      protected void onBeforeRender()
      Overrides:
      onBeforeRender in class AbstractRepeater
    • getPageCount

      public long getPageCount()
      Gets the total number of pages this pageable object has.
      Specified by:
      getPageCount in interface IPageable
      Returns:
      The total number of pages this pageable object has
    • setCurrentPage

      public void setCurrentPage(long page)
      Sets the a page that should be rendered.
      Specified by:
      setCurrentPage in interface IPageable
      Parameters:
      page - The page that should be rendered.
    • setMaxFirstItemReached

      public void setMaxFirstItemReached(long maxFirstItemReached)
      You should never need this method unless your pagingNavigator uses pageParametres and dataSource is with unknown item count
      Parameters:
      maxFirstItemReached -
    • clearCache

      public void clearCache()
      clears the queryResult so the next use will be forced to re-initialize
    • wrapQuery

      protected IDataSource.IQuery wrapQuery(IDataSource.IQuery original)
      Allows to wrap created query.
      Parameters:
      original -
      Returns:
    • onDetach

      protected void onDetach()
      Cleanup
      Overrides:
      onDetach in class MarkupContainer
    • getSortState

      protected abstract IGridSortState getSortState()
    • getDataSource

      protected abstract IDataSource<T> getDataSource()
    • getRowsPerPage

      protected abstract long getRowsPerPage()
    • getItemModels

      protected Iterator<IModel<T>> getItemModels()
      Specified by:
      getItemModels in class RefreshingView<T>
      See Also: