Class BeanListPageElement<T>

All Implemented Interfaces:
ListItemSelection

public class BeanListPageElement<T> extends ListPageElement<T> implements ListItemSelection
  • Field Details

    • NO_RESULT_ATTRIBUTE

      public static final String NO_RESULT_ATTRIBUTE
      See Also:
    • context

      protected final DBContext context
    • rowset

      protected final DBRowSet rowset
    • defaultSortColumn

      protected Column defaultSortColumn
    • defaultSortAscending

      protected boolean defaultSortAscending
    • secondarySortOrder

      protected DBOrderByExpr secondarySortOrder
    • maxItemCount

      protected int maxItemCount
  • Constructor Details

    • BeanListPageElement

      public BeanListPageElement(Page page, Class<T> beanClass, DBContext context, DBRowSet rowset, DBColumn defaultSortColumn, String propertyName)
      Constructor for creating a BeanListPageElement
      Parameters:
      page - the page element
      beanClass - the bean class
      context - the database context
      rowset - required Table or View
      defaultSortColumn - sort column that must belong to rowset
      propertyName - the property name which is used to get and retrieve session information
    • BeanListPageElement

      public BeanListPageElement(Page page, Class<T> beanClass, DBContext context, DBColumn defaultSortColumn, String propertyName)
      Overload that requires a default sort order to be provided
      Parameters:
      page - the page element
      beanClass - the bean class
      context - the database context
      defaultSortColumn - the default sort column
      propertyName - the property name which is used to get and retrieve session information
    • BeanListPageElement

      public BeanListPageElement(Page page, Class<T> beanClass, DBContext context, DBColumn defaultSortColumn)
      Overload that requires a default sort order to be provided
      Parameters:
      page - the page element
      beanClass - the bean class
      context - the database context
      defaultSortColumn - the default sort column
    • BeanListPageElement

      public BeanListPageElement(Page page, Class<T> beanClass, DBContext context, DBRowSet rowSet)
      Overload that requires a default sort order to be provided
      Parameters:
      page - the page element
      beanClass - the bean class
      context - the database context
      rowSet - required Table or View
  • Method Details

    • onInitPage

      protected void onInitPage()
      Overrides:
      onInitPage in class PageElement<Page>
    • onRefreshPage

      protected void onRefreshPage()
      Overrides:
      onRefreshPage in class PageElement<Page>
    • getItemCount

      public int getItemCount()
      Description copied from class: ListPageElement
      returns the total item count of the entire list (not just the visible part)
      Overrides:
      getItemCount in class ListPageElement<T>
      Returns:
      the total number of items in the list
    • getDefaultSortColumn

      public Column getDefaultSortColumn()
    • isDefaultSortAscending

      public boolean isDefaultSortAscending()
    • setDefaultSortAscending

      public void setDefaultSortAscending(boolean defaultSortAscending)
    • getSecondarySortOrder

      public DBOrderByExpr getSecondarySortOrder()
    • setSecondarySortOrder

      public void setSecondarySortOrder(DBOrderByExpr secondarySortOrder)
    • getTableInfo

      public ListPageElement.ListTableInfo getTableInfo()
      session scoped properties
      Specified by:
      getTableInfo in class ListPageElement<T>
    • clearItems

      public void clearItems()
      Overrides:
      clearItems in class ListPageElement<T>
    • getParameterMap

      protected ParameterMap getParameterMap()
    • initItems

      public void initItems(DBCommand queryCmd, DBCommand countCmd, int pageSize)
      Init list items with pagination
      Parameters:
      queryCmd - the query command
      countCmd - the count command
      pageSize - the page size
    • handleNoResult

      protected void handleNoResult()
      handle the case of an empty query result
    • initItems

      public final void initItems(DBCommand queryCmd, int pageSize)
      Init list items without pagination
      Parameters:
      queryCmd - the query commmand
      pageSize - the page size
    • initItems

      public final void initItems(DBCommand queryCmd)
      Init list items without pagination
      Parameters:
      queryCmd - the query commmand
    • isResultEmpty

      public boolean isResultEmpty()
      Returns true if (and only if) items are valid but empty
      Returns:
      true if reault is empty
    • loadItems

      protected void loadItems(boolean initialize)
      loads all visible list items from the database
      Parameters:
      initialize - flag whether to initialize or update the pagination / scrollbar
    • setOrderBy

      protected void setOrderBy(DBCommand cmd)
      set order by for db queries
      Parameters:
      cmd - the command
    • setOrderBy

      protected void setOrderBy(DBCommand cmd, DBColumnExpr sortColumn, boolean sortAscending)
    • initScrollbar

      public void initScrollbar()
      Allows to initialize the scrollbar (if present)
    • updateScrollbar

      public void updateScrollbar()
      Allows to update the scrollbar (if present)
    • getScrollbarPosition

      public int getScrollbarPosition()
    • setScrollbarPosition

      public void setScrollbarPosition(int value)
    • positionValueChanged

      public void positionValueChanged(javax.faces.event.ValueChangeEvent ve)
    • initListItems

      protected void initListItems(List<?> items)
    • initListItem

      protected void initListItem(Object item, Object[] key)
    • getItemKey

      protected Object[] getItemKey(Column[] cols, Object item)
    • getItemQueryCmd

      public DBCommand getItemQueryCmd()
      Specified by:
      getItemQueryCmd in interface ListItemSelection