org.apache.empire.jsf2.pageelements
Class BeanListPageElement<T>

java.lang.Object
  extended by org.apache.empire.jsf2.pages.PageElement
      extended by org.apache.empire.jsf2.pageelements.ListPageElement<T>
          extended by org.apache.empire.jsf2.pageelements.BeanListPageElement<T>
All Implemented Interfaces:
Serializable, ListItemSelection

public class BeanListPageElement<T>
extends ListPageElement<T>
implements ListItemSelection

See Also:
Serialized Form

Nested Class Summary
static class BeanListPageElement.BeanListTableInfo
          Extended ListTableInfo
 
Nested classes/interfaces inherited from class org.apache.empire.jsf2.pageelements.ListPageElement
ListPageElement.ListTableInfo, ListPageElement.SelectableItem, ListPageElement.SelectionSet
 
Field Summary
protected  boolean defaultSortAscending
           
protected  Column defaultSortColumn
           
static String IDPARAM_PROPERTY
           
protected  int maxItemCount
           
static String NO_RESULT_ATTRIBUTE
           
protected  DBRowSet rowset
           
protected  DBOrderByExpr secondarySortOrder
           
 
Fields inherited from class org.apache.empire.jsf2.pageelements.ListPageElement
beanClass, items, selectedItems
 
Constructor Summary
BeanListPageElement(Page page, Class<T> beanClass, DBColumn defaultSortColumn, String propertyName)
           
 
Method Summary
 void clearItems()
           
protected  void generateIdParams(DBRowSet rowset, List<?> items)
           
 Column getDefaultSortColumn()
           
 int getItemCount()
          returns the total item count of the entire list (not just the visible part)
protected  Object[] getItemKey(DBColumn[] cols, Object item)
           
 DBCommand getItemQueryCmd()
           
protected  ParameterMap getParameterMap()
           
 int getScrollbarPosition()
           
 DBOrderByExpr getSecondarySortOrder()
           
 Set<Object[]> getSelectedItemKeys()
           
 ListPageElement.ListTableInfo getTableInfo()
          session scoped properties
 void initItems(DBCommand queryCmd)
          Init list items without pagination
 void initItems(DBCommand queryCmd, DBCommand countCmd, int pageSize)
          Init list items with pagination
 void initItems(DBCommand queryCmd, int pageSize)
          Init list items without pagination
 void initScrollbar()
          addJavascriptCall to initScrollbar
 boolean isDefaultSortAscending()
           
 boolean isResultEmpty()
          Returns true if (and only if) items are valid but empty
protected  void loadItems(boolean initScrollbar)
          loads all visible list items from the database
protected  void onInitPage()
           
protected  void onRefreshPage()
           
 void positionValueChanged(javax.faces.event.ValueChangeEvent ve)
           
 void setDefaultSortAscending(boolean defaultSortAscending)
           
protected  void setOrderBy(DBCommand cmd)
          set order by for db queries
protected  void setOrderBy(DBCommand cmd, DBColumnExpr sortColumn, boolean sortAscending)
           
 void setScrollbarPosition(int value)
           
 void setSecondarySortOrder(DBOrderByExpr secondarySortOrder)
           
 void setSelectedItems(Set<Object[]> items)
           
 void updateScrollbar()
          addJavascriptCall to updateScrollbar
 
Methods inherited from class org.apache.empire.jsf2.pageelements.ListPageElement
assignSelectionMap, clearSelection, getItems, getSelectedItemCount, getSelectedItems, isBlank, isEmpty, isHasSelection, isInvertSelection, isNotEmpty, isSingleSelection, isValid, setInvertSelection, setSelection, setSelection, setSingleSelection
 
Methods inherited from class org.apache.empire.jsf2.pages.PageElement
getConnection, getConnection, getPage, getPropertyName, getSessionObject, removeSessionObject, setSessionObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDPARAM_PROPERTY

public static final String IDPARAM_PROPERTY
See Also:
Constant Field Values

NO_RESULT_ATTRIBUTE

public static final String NO_RESULT_ATTRIBUTE
See Also:
Constant Field Values

rowset

protected DBRowSet rowset

defaultSortColumn

protected Column defaultSortColumn

defaultSortAscending

protected boolean defaultSortAscending

secondarySortOrder

protected DBOrderByExpr secondarySortOrder

maxItemCount

protected int maxItemCount
Constructor Detail

BeanListPageElement

public BeanListPageElement(Page page,
                           Class<T> beanClass,
                           DBColumn defaultSortColumn,
                           String propertyName)
Method Detail

onInitPage

protected void onInitPage()
Overrides:
onInitPage in class PageElement

onRefreshPage

protected void onRefreshPage()
Overrides:
onRefreshPage in class PageElement

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 -
pageSize -

initItems

public final void initItems(DBCommand queryCmd,
                            int pageSize)
Init list items without pagination

Parameters:
queryCmd -

initItems

public final void initItems(DBCommand queryCmd)
Init list items without pagination

Parameters:
queryCmd -

isResultEmpty

public boolean isResultEmpty()
Returns true if (and only if) items are valid but empty

Returns:

loadItems

protected void loadItems(boolean initScrollbar)
loads all visible list items from the database

Parameters:
initScrollbar -

setOrderBy

protected void setOrderBy(DBCommand cmd)
set order by for db queries

Parameters:
cmd -

setOrderBy

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

initScrollbar

public void initScrollbar()
addJavascriptCall to initScrollbar


updateScrollbar

public void updateScrollbar()
addJavascriptCall to updateScrollbar


getScrollbarPosition

public int getScrollbarPosition()

setScrollbarPosition

public void setScrollbarPosition(int value)

positionValueChanged

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

getSelectedItemKeys

public Set<Object[]> getSelectedItemKeys()

setSelectedItems

public void setSelectedItems(Set<Object[]> items)

generateIdParams

protected void generateIdParams(DBRowSet rowset,
                                List<?> items)

getItemKey

protected Object[] getItemKey(DBColumn[] cols,
                              Object item)

getItemQueryCmd

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


Copyright © 2008–2014 Apache Software Foundation. All rights reserved.