org.openfaces.component.table
Class DataTable

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIData
              extended by org.openfaces.component.OUIData
                  extended by org.openfaces.component.table.AbstractTable
                      extended by org.openfaces.component.table.DataTable
All Implemented Interfaces:
java.util.EventListener, javax.faces.component.NamingContainer, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.UniqueIdVendor, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder, ComponentWithExternalParts, FilterableComponent, OUIComponent, TableStyles

public class DataTable
extends AbstractTable

The DataTable component is used to display data in a tabular format and effectively manipulate it. It supports the features of the JSF HtmlDataTable component and extends the standard functionality with such advanced features as sorting, row selection (both multiple and single), pagination, filtering, keyboard navigation, and dynamic data loading (using Ajax.) Plus, the DataTable component provides special support for handling large datasets with minimal overhead.


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIComponent
BEANINFO_KEY, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
DataTable()
           
 
Method Summary
 void encodeBegin(javax.faces.context.FacesContext facesContext)
          Perform necessary actions when rendering of this component starts, before delegating to the inherited implementation which calls the associated renderer's encodeBegin method.
 void encodeChildren(javax.faces.context.FacesContext context)
           
 void encodeEnd(javax.faces.context.FacesContext context)
           
 void filterChanged(Filter filter)
           
 boolean getCustomDataProviding()
           
 java.lang.String getFamily()
           
 int getPageCount()
           
 int getPageIndex()
           
 int getPageIndexForRowKey(java.lang.Object rowKey)
           
 int getPageSize()
           
 java.lang.String getRowIndexVar()
           
 java.util.List getRowListForFiltering(Filter filter)
           
 javax.el.ValueExpression getValueExpression()
           
 boolean isDataSourceEmpty()
           
 boolean isPaginationKeyboardSupport()
           
 void restoreState(javax.faces.context.FacesContext facesContext, java.lang.Object object)
           
 java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
           
 void setCustomDataProviding(boolean customDataProviding)
           
 void setPageIndex(int pageIndex)
           
 void setPageSize(int pageSize)
           
 void setPaginationKeyboardSupport(boolean paginationKeyboardSupport)
           
 void setRowIndex(int rowIndex)
          Set the current row index that methods like getRowData use.
 void setRowIndexVar(java.lang.String rowIndexVar)
           
 void setValueExpression(java.lang.String name, javax.el.ValueExpression expression)
           
 void setValueExpression(javax.el.ValueExpression value)
           
 void updateModel(boolean updateSortingFromBindings, boolean updatePageIndex, boolean readActualData)
          This method is invoked during the normal DataTable operation, and application developers shouldn't invoke this method explicitly.
 
Methods inherited from class org.openfaces.component.table.AbstractTable
getAbove, getAlign, getAllColumns, getAllRecordsFilterText, getApplyDefaultStyle, getAutoFilterDelay, getBelow, getBgcolor, getBodyOddRowClass, getBodyOddRowStyle, getBodyRowClass, getBodyRowStyle, getBodySectionClass, getBodySectionStyle, getBorder, getCellpadding, getCellspacing, getClientId, getColumnIdVar, getColumnIndexVar, getColumnReordering, getColumnResizing, getColumnsOrder, getCommonFooterRowClass, getCommonFooterRowStyle, getCommonFooterSeparator, getCommonHeaderRowClass, getCommonHeaderRowStyle, getCommonHeaderSeparator, getDeferBodyLoading, getDir, getEmptyRecordsFilterText, getExternalPartIds, getFilteredValueByData, getFilters, getFocusedClass, getFocusedStyle, getFooterHorizSeparator, getFooterRowClass, getFooterRowStyle, getFooterSectionClass, getFooterSectionStyle, getFooterVertSeparator, getHeaderHorizSeparator, getHeaderRowClass, getHeaderRowStyle, getHeaderSectionClass, getHeaderSectionStyle, getHeaderVertSeparator, getHorizontalGridLines, getMultiFooterSeparator, getMultiHeaderSeparator, getNoDataMessage, getNoDataMessageAllowed, getNoDataRowClass, getNoDataRowStyle, getNoFilterDataMessage, getNonEmptyRecordsFilterText, getRenderedColumns, getRolloverRowClass, getRolloverRowStyle, getRowIndexByClientSuffix, getRules, getScrolling, getSelection, getSortableHeaderClass, getSortableHeaderRolloverClass, getSortableHeaderRolloverStyle, getSortableHeaderStyle, getSortColumnId, getSortColumnIndex, getSortedAscendingImageUrl, getSortedColumnBodyClass, getSortedColumnBodyStyle, getSortedColumnClass, getSortedColumnFooterClass, getSortedColumnFooterStyle, getSortedColumnHeaderClass, getSortedColumnHeaderStyle, getSortedColumnStyle, getSortedDescendingImageUrl, getSubHeaderRowClass, getSubHeaderRowSeparator, getSubHeaderRowStyle, getTabindex, getTotalRowCount, getUseAjax, getValue, getVerticalGridLines, getWidth, invokeBeforeProcessDecodes, invokeBeforeRenderResponse, isRowAvailable, isSortAscending, processDecodes, processEvent, processSaveState, processUpdates, processValidators, setAbove, setAlign, setAllRecordsFilterText, setApplyDefaultStyle, setAutoFilterDelay, setBelow, setBgcolor, setBodyOddRowClass, setBodyOddRowStyle, setBodyRowClass, setBodyRowStyle, setBodySectionClass, setBodySectionStyle, setBorder, setCellpadding, setCellspacing, setColumnIdVar, setColumnIndexVar, setColumnsOrder, setCommonFooterRowClass, setCommonFooterRowStyle, setCommonFooterSeparator, setCommonHeaderRowClass, setCommonHeaderRowStyle, setCommonHeaderSeparator, setDeferBodyLoading, setDir, setEmptyRecordsFilterText, setFocusedClass, setFocusedStyle, setFooterHorizSeparator, setFooterRowClass, setFooterRowStyle, setFooterSectionClass, setFooterSectionStyle, setFooterVertSeparator, setHeaderHorizSeparator, setHeaderRowClass, setHeaderRowStyle, setHeaderSectionClass, setHeaderSectionStyle, setHeaderVertSeparator, setHorizontalGridLines, setId, setMultiFooterSeparator, setMultiHeaderSeparator, setNoDataMessageAllowed, setNoDataRowClass, setNoDataRowStyle, setNonEmptyRecordsFilterText, setParent, setRolloverRowClass, setRolloverRowStyle, setRules, setSelection, setSortableHeaderClass, setSortableHeaderRolloverClass, setSortableHeaderRolloverStyle, setSortableHeaderStyle, setSortAscending, setSortColumnId, setSortColumnIndex, setSortedAscendingImageUrl, setSortedColumnBodyClass, setSortedColumnBodyStyle, setSortedColumnClass, setSortedColumnFooterClass, setSortedColumnFooterStyle, setSortedColumnHeaderClass, setSortedColumnHeaderStyle, setSortedColumnStyle, setSortedDescendingImageUrl, setSubHeaderRowClass, setSubHeaderRowSeparator, setSubHeaderRowStyle, setTabindex, setUseAjax, setValue, setVerticalGridLines, setWidth, toggleSorting, toggleSorting, visitTree
 
Methods inherited from class org.openfaces.component.OUIData
broadcast, createUniqueId, getFirst, getFooter, getHeader, getOnblur, getOnclick, getOncontextmenu, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getRolloverClass, getRolloverStyle, getRowCount, getRowData, getRowIndex, getRows, getStyle, getStyleClass, getUiDataValue, getVar, invokeOnComponent, isRowAvailableAfterRestoring, queueEvent, restoreDescendantComponentStates, saveDescendantComponentStates, setFirst, setFooter, setHeader, setOnblur, setOnclick, setOncontextmenu, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setRolloverClass, setRolloverStyle, setRows, setStyle, setStyleClass, setUiDataValue, setVar
 
Methods inherited from class javax.faces.component.UIData
setValueBinding
 
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, clearInitialState, decode, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getDefaultEventName, getEventNames, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, markInitialState, processRestoreState, restoreAttachedState, saveAttachedState, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getValueExpression, initialStateMarked, isCompositeComponent, isInView, popComponentFromEL, pushComponentToEL, setInView, subscribeToEvent, unsubscribeFromEvent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openfaces.component.TableStyles
getFooter, getHeader
 
Methods inherited from interface org.openfaces.component.FilterableComponent
getVar
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values
Constructor Detail

DataTable

public DataTable()
Method Detail

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class OUIData

setValueExpression

public void setValueExpression(java.lang.String name,
                               javax.el.ValueExpression expression)
Overrides:
setValueExpression in class OUIData

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class AbstractTable

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext,
                         java.lang.Object object)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class AbstractTable

getPageSize

public int getPageSize()
Returns:
Returns the size of a page if the table is being paged and zero if the table is not being paged.

setPageSize

public void setPageSize(int pageSize)

getPageIndex

public int getPageIndex()

setPageIndex

public void setPageIndex(int pageIndex)

getRowIndexVar

public java.lang.String getRowIndexVar()

setRowIndexVar

public void setRowIndexVar(java.lang.String rowIndexVar)

isPaginationKeyboardSupport

public boolean isPaginationKeyboardSupport()

setPaginationKeyboardSupport

public void setPaginationKeyboardSupport(boolean paginationKeyboardSupport)

getPageCount

public int getPageCount()
Returns:
the number of pages if pagination is currently enabled. If pagination is disabled (by setting pageSize to 0) or if the total number of rows is unknown then -1 is returned. Note the that if pagination is enabled then there will always be at least one page even if there are no rows to show.

getValueExpression

public javax.el.ValueExpression getValueExpression()

setValueExpression

public void setValueExpression(javax.el.ValueExpression value)

getPageIndexForRowKey

public int getPageIndexForRowKey(java.lang.Object rowKey)
Parameters:
rowKey - row key object for a row whose page index should be detected.
Returns:
index of a page where a row with the specified rowKey is displayed, or -1 of no such row is being displayed.

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext facesContext)
                 throws java.io.IOException
Description copied from class: OUIData
Perform necessary actions when rendering of this component starts, before delegating to the inherited implementation which calls the associated renderer's encodeBegin method.

Overrides:
encodeBegin in class OUIData
Throws:
java.io.IOException

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context)
                    throws java.io.IOException
Overrides:
encodeChildren in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context)
               throws java.io.IOException
Overrides:
encodeEnd in class OUIData
Throws:
java.io.IOException
See Also:
UIComponentBase.encodeEnd(javax.faces.context.FacesContext)

updateModel

public void updateModel(boolean updateSortingFromBindings,
                        boolean updatePageIndex,
                        boolean readActualData)
This method is invoked during the normal DataTable operation, and application developers shouldn't invoke this method explicitly. Note that this method returns the proper value only after the DataTable is rendered for the first time.


getRowListForFiltering

public java.util.List getRowListForFiltering(Filter filter)

isDataSourceEmpty

public boolean isDataSourceEmpty()
Specified by:
isDataSourceEmpty in class AbstractTable

setRowIndex

public void setRowIndex(int rowIndex)
Description copied from class: OUIData
Set the current row index that methods like getRowData use.

Param rowIndex can be -1, meaning "no row".

Overrides:
setRowIndex in class OUIData

getCustomDataProviding

public boolean getCustomDataProviding()

setCustomDataProviding

public void setCustomDataProviding(boolean customDataProviding)

filterChanged

public void filterChanged(Filter filter)
Specified by:
filterChanged in interface FilterableComponent
Overrides:
filterChanged in class AbstractTable


Copyright © 1998-2010 TeamDev Ltd. All Rights Reserved.