Class BeanListPageElement<T>
java.lang.Object
org.apache.empire.jsf2.pages.PageElement<Page>
org.apache.empire.jsf2.pageelements.ListPageElement<T>
org.apache.empire.jsf2.pageelements.BeanListPageElement<T>
- All Implemented Interfaces:
ListItemSelection
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classExtended ListTableInfoNested classes/interfaces inherited from class org.apache.empire.jsf2.pageelements.ListPageElement
ListPageElement.ListTableInfo, ListPageElement.ParameterizedItem, ListPageElement.SelectableItem, ListPageElement.SelectionSet -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DBContextprotected booleanprotected Columnprotected intstatic final Stringprotected final DBRowSetprotected DBOrderByExprFields inherited from class org.apache.empire.jsf2.pageelements.ListPageElement
beanClass, items, selectedItemKeysFields inherited from class org.apache.empire.jsf2.pages.PageElement
page -
Constructor Summary
ConstructorsConstructorDescriptionOverload that requires a default sort order to be providedBeanListPageElement(Page page, Class<T> beanClass, DBContext context, DBColumn defaultSortColumn, String propertyName) Overload that requires a default sort order to be providedOverload that requires a default sort order to be providedBeanListPageElement(Page page, Class<T> beanClass, DBContext context, DBRowSet rowset, DBColumn defaultSortColumn, String propertyName) Constructor for creating a BeanListPageElement -
Method Summary
Modifier and TypeMethodDescriptionvoidintreturns the total item count of the entire list (not just the visible part)protected Object[]getItemKey(Column[] cols, Object item) protected ParameterMapintsession scoped propertiesprotected voidhandle the case of an empty query resultfinal voidInit list items without paginationfinal voidInit list items without paginationvoidInit list items with paginationprotected voidinitListItem(Object item, Object[] key) protected voidinitListItems(List<?> items) voidAllows to initialize the scrollbar (if present)booleanbooleanReturns true if (and only if) items are valid but emptyprotected voidloadItems(boolean initialize) loads all visible list items from the databaseprotected voidprotected voidvoidpositionValueChanged(javax.faces.event.ValueChangeEvent ve) voidsetDefaultSortAscending(boolean defaultSortAscending) protected voidsetOrderBy(DBCommand cmd) set order by for db queriesprotected voidsetOrderBy(DBCommand cmd, DBColumnExpr sortColumn, boolean sortAscending) voidsetScrollbarPosition(int value) voidsetSecondarySortOrder(DBOrderByExpr secondarySortOrder) voidAllows to update the scrollbar (if present)Methods inherited from class org.apache.empire.jsf2.pageelements.ListPageElement
clearSelection, getItems, getSelectedItemCount, getSelectedItemKeys, getSelectedItems, isBlank, isEmpty, isHasSelection, isInvertSelection, isNotEmpty, isSingleSelection, isValid, setInvertSelection, setSelectedItems, setSelection, setSelection, setSingleSelectionMethods inherited from class org.apache.empire.jsf2.pages.PageElement
getDefaultPropertyName, getPage, getPropertyName, getSessionObject, removeSessionObject, setSessionObject
-
Field Details
-
NO_RESULT_ATTRIBUTE
- See Also:
-
context
-
rowset
-
defaultSortColumn
-
defaultSortAscending
protected boolean defaultSortAscending -
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 elementbeanClass- the bean classcontext- the database contextrowset- required Table or ViewdefaultSortColumn- sort column that must belong to rowsetpropertyName- 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 elementbeanClass- the bean classcontext- the database contextdefaultSortColumn- the default sort columnpropertyName- 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 elementbeanClass- the bean classcontext- the database contextdefaultSortColumn- the default sort column
-
BeanListPageElement
Overload that requires a default sort order to be provided- Parameters:
page- the page elementbeanClass- the bean classcontext- the database contextrowSet- required Table or View
-
-
Method Details
-
onInitPage
protected void onInitPage()- Overrides:
onInitPagein classPageElement<Page>
-
onRefreshPage
protected void onRefreshPage()- Overrides:
onRefreshPagein classPageElement<Page>
-
getItemCount
public int getItemCount()Description copied from class:ListPageElementreturns the total item count of the entire list (not just the visible part)- Overrides:
getItemCountin classListPageElement<T>- Returns:
- the total number of items in the list
-
getDefaultSortColumn
-
isDefaultSortAscending
public boolean isDefaultSortAscending() -
setDefaultSortAscending
public void setDefaultSortAscending(boolean defaultSortAscending) -
getSecondarySortOrder
-
setSecondarySortOrder
-
getTableInfo
session scoped properties- Specified by:
getTableInfoin classListPageElement<T>
-
clearItems
public void clearItems()- Overrides:
clearItemsin classListPageElement<T>
-
getParameterMap
-
initItems
Init list items with pagination- Parameters:
queryCmd- the query commandcountCmd- the count commandpageSize- the page size
-
handleNoResult
protected void handleNoResult()handle the case of an empty query result -
initItems
Init list items without pagination- Parameters:
queryCmd- the query commmandpageSize- the page size
-
initItems
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
set order by for db queries- Parameters:
cmd- the command
-
setOrderBy
-
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
-
initListItem
-
getItemKey
-
getItemQueryCmd
- Specified by:
getItemQueryCmdin interfaceListItemSelection
-