com.sun.rave.web.ui.component
Class TableRowGroup

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended bycom.sun.rave.web.ui.component.TableRowGroupBase
              extended bycom.sun.rave.web.ui.component.TableRowGroup
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder

public class TableRowGroup
extends TableRowGroupBase
implements javax.faces.component.NamingContainer

Component that represents a group of table rows.

The TableRowGroup component provides a layout mechanism for displaying rows of data. UI guidelines describe specific behavior that can applied to the rows and columns of data such as sorting, filtering, pagination, selection, and custom user actions. In addition, UI guidelines also define sections of the table that can be used for titles, row group headers, and placement of pre-defined and user defined actions.

The TableRowGroup component supports a data binding to a collection of data objects represented by a TableDataProvider instance, which is the current value of this component itself. During iterative processing over the rows of data in the data provider, the TableDataProvider for the current row is exposed as a request attribute under the key specified by the var property.

Only children of type TableColumn should be processed by renderers associated with this component.

Note: Column headers and footers are rendered by TableRowGroupRenderer. Table column footers are rendered by TableRenderer.

Note: To see the messages logged by this class, set the following global defaults in your JDK's "jre/lib/logging.properties" file.

 java.util.logging.ConsoleHandler.level = FINE
 com.sun.rave.web.ui.component.TableRowGroup.level = FINE
 

See TLD docs for more information.


Field Summary
static java.lang.String COLUMN_FOOTER_BAR_ID
          The id for the column footer bar.
static java.lang.String COLUMN_HEADER_BAR_ID
          The id for the column header bar.
static java.lang.String EMPTY_DATA_COLUMN_FACET
          The facet name for the empty data column.
static java.lang.String EMPTY_DATA_COLUMN_ID
          The component id for the empty data column.
static java.lang.String EMPTY_DATA_TEXT_FACET
          The facet name for the empty data text.
static java.lang.String EMPTY_DATA_TEXT_ID
          The component id for the empty data text.
static java.lang.String FOOTER_FACET
          The facet name for the group footer area.
static java.lang.String GROUP_FOOTER_BAR_ID
          The id for the group footer bar.
static java.lang.String GROUP_FOOTER_FACET
          The facet name for the group footer.
static java.lang.String GROUP_FOOTER_ID
          The component id for the group footer.
static java.lang.String GROUP_HEADER_BAR_ID
          The id for the table row group header bar.
static java.lang.String GROUP_HEADER_FACET
          The facet name for the table row group header.
static java.lang.String GROUP_HEADER_ID
          The component id for the table row group header.
static java.lang.String HEADER_FACET
          The facet name for the group header area.
static java.lang.String TABLE_COLUMN_FOOTER_BAR_ID
          The id for the table column footers bar.
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
TableRowGroup()
          Default constructor
 
Method Summary
 void addSort(com.sun.data.provider.SortCriteria criteria)
          Add a SortCriteria object to sort.
 void broadcast(javax.faces.event.FacesEvent event)
          Override the default UIComponentBase.broadcast() processing to unwrap any wrapped FacesEvent and reset the current RowKey, before the event is actually broadcast.
 void clearFilter()
          Clear FilterCriteria objects from the TableDataFilter instance used by this component.
 void clearSort()
          Clear SortCriteria objects from the TableDataSorter instance used by this component.
 void encodeBegin(javax.faces.context.FacesContext context)
          In addition to the default behavior, ensure that any saved per-row state for our child input components is discarded unless it is needed to rerender the current page with errors.
 java.lang.String getClientId(javax.faces.context.FacesContext context)
          Return a client identifier for this component that includes the current value of the RowKey property, if it is not set to null.
 int getColumnCount()
          Get the number of columns found for this component that have a rendered property of true.
 javax.faces.component.UIComponent getEmptyDataColumn()
          Get empty data column.
 javax.faces.component.UIComponent getEmptyDataText()
          Get empty data text.
 com.sun.data.provider.FieldKey getFieldKey(java.lang.String fieldId)
          Get the FieldKey from the underlying TableDataProvider.
 com.sun.data.provider.RowKey[] getFilteredRowKeys()
          Get an array containing filtered RowKey objects.
 int getFirst()
          Get the zero-relative row number of the first row to be displayed for a paginated table.
 javax.faces.component.UIComponent getGroupFooter()
          Get group footer.
 javax.faces.component.UIComponent getGroupHeader()
          Get group header.
 com.sun.data.provider.RowKey[] getHiddenRowKeys()
          Get an array of hidden RowKey objects from the underlying TableDataProvider taking filtering, sorting, and pagination into account.
 com.sun.data.provider.RowKey[] getHiddenSelectedRowKeys()
          Get an array of RowKey objects from the underlying data provider where the selected property of this component is set to true and the row is currently hidden from view.
 int getHiddenSelectedRowsCount()
          Get the number of objects from the underlying data provider where the selected property of this component is set to true and the row is currently hidden from view.
 int getLast()
          Get the zero-relative row number of the last page to be displayed.
 int getPage()
          Get current page number to be displayed.
 int getPages()
          Get total number of pages to be displayed.
 com.sun.data.provider.RowKey[] getRenderedRowKeys()
          Get an array of rendered RowKey objects from the underlying TableDataProvider taking filtering, sorting, and pagination into account.
 com.sun.data.provider.RowKey[] getRenderedSelectedRowKeys()
          Get an array of RowKey objects from the underlying data provider where the selected property of this component is set to true and the row is rendered.
 int getRenderedSelectedRowsCount()
          Get the number of objects from the underlying data provider where the selected property of this component is set to true and the row is rendered.
 int getRowCount()
          Get the number of rows in the underlying TableDataProvider.
 com.sun.data.provider.RowKey getRowKey()
          Get the RowKey associated with the current row.
 com.sun.data.provider.RowKey[] getRowKeys()
          Get all RowKey objects for the underlying TableDataProvider.
 int getRows()
          Get the number of rows to be displayed for a paginated table.
 com.sun.data.provider.RowKey[] getSelectedRowKeys()
          Get an array of RowKey objects from the underlying data provider where the selected property of this component is set to true.
 int getSelectedRowsCount()
          Get the number of selected rows from the underlying data provider where the selected property of this component is set to true.
 int getSortCount()
          Get the number of SortCriteria objects to sort.
 com.sun.data.provider.RowKey[] getSortedRowKeys()
          Get an array containing sorted RowKey objects.
 int getSortLevel(com.sun.data.provider.SortCriteria criteria)
          Get the level of the given SortCriteria object to sort.
 Table getTableAncestor()
          Get the closest Table ancestor that encloses this component.
 java.util.Iterator getTableColumnChildren()
          Get an Iterator over the TableColumn children found for this component.
 com.sun.data.provider.TableDataFilter getTableDataFilter()
          Get the TableDataFilter object used to filter rows.
 com.sun.data.provider.TableDataSorter getTableDataSorter()
          Get the TableDataSorter object used to sort rows.
protected  com.sun.data.provider.impl.TableRowDataProvider getTableRowDataProvider()
          Get the TableRowDataProvider object representing the data objects that we will iterate over in this component's rendering.
 java.lang.Class getType(com.sun.data.provider.FieldKey fieldKey)
          Get the data type of the data element referenced by the given FieldKey.
 boolean isDescendingSort(com.sun.data.provider.SortCriteria criteria)
          Test if given SortCriteria object is a descending sort.
 boolean isPaginated()
          Test the paginated state of this component.
 boolean isRowAvailable()
          Get the flag indicating whether there is row data available for the current RowKey.
 void processDecodes(javax.faces.context.FacesContext context)
          Override the default UIComponentBase.processDecodes() processing to perform the following steps.
 void processUpdates(javax.faces.context.FacesContext context)
          Override the default UIComponentBase.processUpdates() processing to perform the following steps.
 void processValidators(javax.faces.context.FacesContext context)
          Override the default UIComponentBase.processValidators() processing to perform the following steps.
 void queueEvent(javax.faces.event.FacesEvent event)
          Override the default UIComponentBase.queueEvent() processing to wrap any queued events in a wrapper so that we can reset the current RowKey in broadcast().
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext context)
          Save the state of this component.
 void setFilterCriteria(com.sun.data.provider.FilterCriteria[] filterCriteria)
          Set FilterCriteria objects for the TableDataFilter instance used by this component.
 void setFirst(int first)
          Set the zero-relative row number of the first row to be displayed for a paginated table.
 void setPaginated(boolean paginated)
          Set the paginated state of this component.
 void setRowKey(com.sun.data.provider.RowKey rowKey)
          Set the RowKey associated with the current row or null for no current row association.
 void setRows(int rows)
          Set the number of rows to be displayed for a paginated table.
 void setSortCriteria(com.sun.data.provider.SortCriteria[] sortCriteria)
          Set SortCriteria objects for the TableDataSorter instance used by this component.
 void setSourceData(com.sun.data.provider.TableDataProvider sourceData)
          Set the source data of the TableRowGroup.
 void setTableDataFilter(com.sun.data.provider.TableDataFilter filter)
          Set the TableDataFilter object used to filter rows.
 void setTableDataSorter(com.sun.data.provider.TableDataSorter sorter)
          Set the TableDataSorter object used to sort rows.
 void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)
          Set the ValueBinding used to calculate the value for the specified attribute or property name, if any.
 
Methods inherited from class com.sun.rave.web.ui.component.TableRowGroupBase
getAlign, getBgColor, getChar, getCharOff, getEmptyDataMsg, getExtraFooterHtml, getExtraHeaderHtml, getFamily, getFooterText, getHeaderText, getOnClick, getOnDblClick, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getSourceData, getSourceVar, getStyleClasses, getToolTip, getValign, isAboveColumnFooter, isAboveColumnHeader, isCollapsed, isGroupToggleButton, isMultipleColumnFooters, isMultipleTableColumnFooters, isSelected, isSelectMultipleToggleButton, isVisible, setAboveColumnFooter, setAboveColumnHeader, setAlign, setBgColor, setChar, setCharOff, setCollapsed, setEmptyDataMsg, setExtraFooterHtml, setExtraHeaderHtml, setFooterText, setGroupToggleButton, setHeaderText, setMultipleColumnFooters, setMultipleTableColumnFooters, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setSelected, setSelectMultipleToggleButton, setSourceVar, setStyleClasses, setToolTip, setValign, setVisible
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLUMN_FOOTER_BAR_ID

public static final java.lang.String COLUMN_FOOTER_BAR_ID
The id for the column footer bar.

See Also:
Constant Field Values

COLUMN_HEADER_BAR_ID

public static final java.lang.String COLUMN_HEADER_BAR_ID
The id for the column header bar.

See Also:
Constant Field Values

EMPTY_DATA_COLUMN_ID

public static final java.lang.String EMPTY_DATA_COLUMN_ID
The component id for the empty data column.

See Also:
Constant Field Values

EMPTY_DATA_COLUMN_FACET

public static final java.lang.String EMPTY_DATA_COLUMN_FACET
The facet name for the empty data column.

See Also:
Constant Field Values

EMPTY_DATA_TEXT_ID

public static final java.lang.String EMPTY_DATA_TEXT_ID
The component id for the empty data text.

See Also:
Constant Field Values

EMPTY_DATA_TEXT_FACET

public static final java.lang.String EMPTY_DATA_TEXT_FACET
The facet name for the empty data text.

See Also:
Constant Field Values

FOOTER_FACET

public static final java.lang.String FOOTER_FACET
The facet name for the group footer area.

See Also:
Constant Field Values

GROUP_FOOTER_BAR_ID

public static final java.lang.String GROUP_FOOTER_BAR_ID
The id for the group footer bar.

See Also:
Constant Field Values

GROUP_FOOTER_ID

public static final java.lang.String GROUP_FOOTER_ID
The component id for the group footer.

See Also:
Constant Field Values

GROUP_FOOTER_FACET

public static final java.lang.String GROUP_FOOTER_FACET
The facet name for the group footer.

See Also:
Constant Field Values

GROUP_HEADER_BAR_ID

public static final java.lang.String GROUP_HEADER_BAR_ID
The id for the table row group header bar.

See Also:
Constant Field Values

GROUP_HEADER_ID

public static final java.lang.String GROUP_HEADER_ID
The component id for the table row group header.

See Also:
Constant Field Values

GROUP_HEADER_FACET

public static final java.lang.String GROUP_HEADER_FACET
The facet name for the table row group header.

See Also:
Constant Field Values

HEADER_FACET

public static final java.lang.String HEADER_FACET
The facet name for the group header area.

See Also:
Constant Field Values

TABLE_COLUMN_FOOTER_BAR_ID

public static final java.lang.String TABLE_COLUMN_FOOTER_BAR_ID
The id for the table column footers bar.

See Also:
Constant Field Values
Constructor Detail

TableRowGroup

public TableRowGroup()
Default constructor

Method Detail

getTableAncestor

public Table getTableAncestor()
Get the closest Table ancestor that encloses this component.

Returns:
The Table ancestor.

getTableColumnChildren

public java.util.Iterator getTableColumnChildren()
Get an Iterator over the TableColumn children found for this component.

Returns:
An Iterator over the TableColumn children.

getColumnCount

public int getColumnCount()
Get the number of columns found for this component that have a rendered property of true.

Returns:
The number of rendered columns.

getEmptyDataColumn

public javax.faces.component.UIComponent getEmptyDataColumn()
Get empty data column.

Returns:
The empty data column.

getEmptyDataText

public javax.faces.component.UIComponent getEmptyDataText()
Get empty data text.

Returns:
The empty data text.

getGroupFooter

public javax.faces.component.UIComponent getGroupFooter()
Get group footer.

Returns:
The group footer.

getGroupHeader

public javax.faces.component.UIComponent getGroupHeader()
Get group header.

Returns:
The group header.

clearFilter

public void clearFilter()
Clear FilterCriteria objects from the TableDataFilter instance used by this component.

Note: This method clears the cached filter and sort, then resets pagination to the first page per UI guidelines.


getFilteredRowKeys

public com.sun.data.provider.RowKey[] getFilteredRowKeys()
Get an array containing filtered RowKey objects.

Note: This filter depends on the FilterCriteria objects provided to the TableDataFilter instance used by this component. Due to filtering, the size of the returned array may be less than the total number of RowKey objects for the underlying TableDataProvider.

Note: The returned RowKey objects are cached. If the TableDataFilter instance used by this component is modified directly, invoke the clearFilter method to clear the previous filter.

Returns:
An array containing filtered RowKey objects.

getTableDataFilter

public com.sun.data.provider.TableDataFilter getTableDataFilter()
Get the TableDataFilter object used to filter rows.

Overrides:
getTableDataFilter in class TableRowGroupBase
Returns:
The TableDataFilter object used to filter rows.

setFilterCriteria

public void setFilterCriteria(com.sun.data.provider.FilterCriteria[] filterCriteria)
Set FilterCriteria objects for the TableDataFilter instance used by this component.

Note: This method clears the cached filter and sort, then resets pagination to the first page per UI guidelines.

Parameters:
filterCriteria - An array of FilterCriteria objects defining the filter order on this TableDataFilter.

setTableDataFilter

public void setTableDataFilter(com.sun.data.provider.TableDataFilter filter)
Set the TableDataFilter object used to filter rows.

Overrides:
setTableDataFilter in class TableRowGroupBase
Parameters:
filter - The TableDataFilter object used to filter rows.
See Also:
TableRowGroupBase.getTableDataFilter()

getFirst

public int getFirst()
Get the zero-relative row number of the first row to be displayed for a paginated table.

Note: When ever a new DataProvider is used, UI Guiedlines recommend that pagination should be reset (e.g., remaining on the 4th page of a new set of data makes no sense).

Note: If rows have been removed from the table, there is a chance that the first row could be greater than the total number of rows. In this case, the zero-relative row number of the last page to be displayed is returned.

Overrides:
getFirst in class TableRowGroupBase
Returns:
The zero-relative row number of the first row to be displayed.

setFirst

public void setFirst(int first)
Set the zero-relative row number of the first row to be displayed for a paginated table.

Overrides:
setFirst in class TableRowGroupBase
Parameters:
first - The first row number.
Throws:
java.lang.IllegalArgumentException - for negative values.
See Also:
TableRowGroupBase.getFirst()

getLast

public int getLast()
Get the zero-relative row number of the last page to be displayed.

Returns:
The zero-relative row number of the last page to be displayed.

getPage

public int getPage()
Get current page number to be displayed.

Note: The default is 1 when the table is not paginated.

Returns:
The current page number to be displayed.

getPages

public int getPages()
Get total number of pages to be displayed. The default is 1 when the table is not paginated.

Note: The page count depends on the FilterCriteria objects provided to the TableDataFilter instance used by this component. Further, the filter used to obtain the page count is cached. If the TableDataFilter instance used by this component is to be modified directly, invoke the clearFilter method to clear the previous filter.

Returns:
The total number of pages to be displayed.

isPaginated

public boolean isPaginated()
Test the paginated state of this component.

Note: If the paginationControls property of the Table component is true, this property will be initialized as true.

Returns:
true for paginate mode, false for scroll mode.

setPaginated

public void setPaginated(boolean paginated)
Set the paginated state of this component.

Note: When pagination controls are used, a value of true allows both pagination controls and paginate buttons to be displayed. A value of false allows only paginate buttons to be displayed. However, when all data fits on one page, neither pagination controls or paginate buttons are displayed.

Note: To properly maintain the paginated state of the table per UI guidelines, the paginated property is cached. If the paginationControls property of the table component changes (e.g., in an application builder environment), use this method to set the paginated property accordingly.

Parameters:
paginated - The paginated state of this component.

getRows

public int getRows()
Get the number of rows to be displayed for a paginated table.

Note: UI guidelines recommend a default value of 25 rows per page.

Overrides:
getRows in class TableRowGroupBase
Returns:
The number of rows to be displayed for a paginated table.

setRows

public void setRows(int rows)
Set the number of rows to be displayed for a paginated table.

Overrides:
setRows in class TableRowGroupBase
Parameters:
rows - The number of rows to be displayed for a paginated table.
Throws:
java.lang.IllegalArgumentException - for negative values.
See Also:
TableRowGroupBase.getRows()

isRowAvailable

public boolean isRowAvailable()
Get the flag indicating whether there is row data available for the current RowKey. If no row data is available, false is returned.

Returns:
The flag indicating whether there is row data available.

getHiddenRowKeys

public com.sun.data.provider.RowKey[] getHiddenRowKeys()
Get an array of hidden RowKey objects from the underlying TableDataProvider taking filtering, sorting, and pagination into account.

Note: The returned RowKey objects depend on the FilterCriteria and SortCriteria objects provided to the TableDataFilter and TableDataSorter instances used by this component. If TableDataFilter and TableDataSorter are modified directly, invoke the clearSort and clearFilter method to clear the previous sort and filter.

Returns:
An array of RowKey objects.

getFieldKey

public com.sun.data.provider.FieldKey getFieldKey(java.lang.String fieldId)
Get the FieldKey from the underlying TableDataProvider.

Parameters:
fieldId - The id of the requested FieldKey.
Returns:
The RowKey from the underlying TableDataProvider.

getRowCount

public int getRowCount()
Get the number of rows in the underlying TableDataProvider. If the number of available rows is unknown, -1 is returned.

Note: This row count depends on the FilterCriteria objects provided to the TableDataFilter instance used by this component. Further, the filter used to obtain the row count is cached. If the TableDataFilter instance used by this component is modified directly, invoke the clearFilter method to clear the previous filter.

Returns:
The number of rows in the underlying TableDataProvider.

getRowKey

public com.sun.data.provider.RowKey getRowKey()
Get the RowKey associated with the current row.

Returns:
The RowKey associated with the current row.

getRowKeys

public com.sun.data.provider.RowKey[] getRowKeys()
Get all RowKey objects for the underlying TableDataProvider.

Returns:
All RowKey objects for the underlying TableDataProvider.

getTableRowDataProvider

protected com.sun.data.provider.impl.TableRowDataProvider getTableRowDataProvider()
Get the TableRowDataProvider object representing the data objects that we will iterate over in this component's rendering.

Returns:
The TableRowDataProvider object.

getType

public java.lang.Class getType(com.sun.data.provider.FieldKey fieldKey)
Get the data type of the data element referenced by the given FieldKey.

Parameters:
fieldKey - The FieldKey identifying the data element whose type is to be returned.
Returns:
The data type of the data element referenced by the given FieldKey.

getRenderedRowKeys

public com.sun.data.provider.RowKey[] getRenderedRowKeys()
Get an array of rendered RowKey objects from the underlying TableDataProvider taking filtering, sorting, and pagination into account.

Note: The returned RowKey objects depend on the FilterCriteria and SortCriteria objects provided to the TableDataFilter and TableDataSorter instances used by this component. If TableDataFilter and TableDataSorter are modified directly, invoke the clearSort and clearFilter method to clear the previous sort and filter.

Returns:
An array of RowKey objects.

setRowKey

public void setRowKey(com.sun.data.provider.RowKey rowKey)
Set the RowKey associated with the current row or null for no current row association.

Note: It is possible to set the RowKey at a value for which the underlying TableDataProvider does not contain any row data. Therefore, callers may use the isRowAvailable() method to detect whether row data will be available.

To save current state information for all descendant components, TableRowGroup must maintain per-row information for each descendant as follows:

To restore current state information for all descendant components, TableRowGroup must reference its previously stored information for the current RowKey and call setters for each descendant as follows:

Parameters:
rowKey - The RowKey associated with the current row or null for no association.

setSourceData

public void setSourceData(com.sun.data.provider.TableDataProvider sourceData)
Set the source data of the TableRowGroup.

Note: When ever a new DataProvider is used, UI Guiedlines recommend that pagination should be reset (e.g., remaining on the 4th page of a new set of data makes no sense). However, properties such as the sort and filter criteria should not automatically be cleared (e.g., there may be situations where one or both should be left as specified by the user). In this scenario, pagination is set to the first page.

Overrides:
setSourceData in class TableRowGroupBase
Parameters:
sourceData - The source data of the TableRowGroup.
See Also:
TableRowGroupBase.getSourceData()

getHiddenSelectedRowsCount

public int getHiddenSelectedRowsCount()
Get the number of objects from the underlying data provider where the selected property of this component is set to true and the row is currently hidden from view.

Note: UI guidelines recomend that rows should be unselected when no longer in view. For example, when a user selects rows of the table and navigates to another page. Or, when a user applies a filter or sort that may hide previously selected rows from view. If a user invokes an action to delete the currently selected rows, they may inadvertently remove rows not displayed on the current page. That said, there are cases when maintaining state across table pages is necessary. When maintaining state and there are currently no hidden selections, UI guidelines recomend that the number zero should be shown.

Note: This count depends on the FilterCriteria and SortCriteria objects provided to the TableDataFilter and TableDataSorter instances used by this component. If TableDataFilter and TableFilterSorter are modified directly, invoke the clearFilter method to clear the previous filter and sort.

Returns:
The number of selected rows currently hidden from view.

getHiddenSelectedRowKeys

public com.sun.data.provider.RowKey[] getHiddenSelectedRowKeys()
Get an array of RowKey objects from the underlying data provider where the selected property of this component is set to true and the row is currently hidden from view.

Note: UI guidelines recomend that rows should be unselected when no longer in view. For example, when a user selects rows of the table and navigates to another page. Or, when a user applies a filter or sort that may hide previously selected rows from view. If a user invokes an action to delete the currently selected rows, they may inadvertently remove rows not displayed on the current page.

Note: The returned RowKey objects depend on the FilterCriteria and SortCriteria objects provided to the TableDataFilter and TableDataSorter instances used by this component. If TableDataFilter and TableDataSorter are modified directly, invoke the clearSort and clearFilter method to clear the previous sort and filter.

Returns:
An array of RowKey objects.

getSelectedRowsCount

public int getSelectedRowsCount()
Get the number of selected rows from the underlying data provider where the selected property of this component is set to true.

Note: This count depends on the FilterCriteria objects provided to the TableDataFilter instance used by this component. If TableDataFilter is modified directly, invoke the clearFilter method to clear the previous filter.

Returns:
The number of selected rows.

getSelectedRowKeys

public com.sun.data.provider.RowKey[] getSelectedRowKeys()
Get an array of RowKey objects from the underlying data provider where the selected property of this component is set to true.

Note: The returned RowKey objects depend on the FilterCriteria objects provided to the TableDataFilter instance used by this component. If TableDataFilter is modified directly, invoke the clearFilter method to clear the previous filter.

Returns:
An array of RowKey objects.

getRenderedSelectedRowsCount

public int getRenderedSelectedRowsCount()
Get the number of objects from the underlying data provider where the selected property of this component is set to true and the row is rendered.

Note: UI guidelines recomend that rows should be unselected when no longer in view. For example, when a user selects rows of the table and navigates to another page. Or, when a user applies a filter or sort that may hide previously selected rows from view. If a user invokes an action to delete the currently selected rows, they may inadvertently remove rows not displayed on the current page.

Note: This count depends on the FilterCriteria and SortCriteria objects provided to the TableDataFilter and TableDataSorter instances used by this component. If TableDataFilter and TableFilterSorter are modified directly, invoke the clearFilter method to clear the previous filter and sort.

Returns:
The number of selected rows currently hidden from view.

getRenderedSelectedRowKeys

public com.sun.data.provider.RowKey[] getRenderedSelectedRowKeys()
Get an array of RowKey objects from the underlying data provider where the selected property of this component is set to true and the row is rendered.

Note: UI guidelines recomend that rows should be unselected when no longer in view. For example, when a user selects rows of the table and navigates to another page. Or, when a user applies a filter or sort that may hide previously selected rows from view. If a user invokes an action to delete the currently selected rows, they may inadvertently remove rows not displayed on the current page.

Note: The returned RowKey objects depend on the FilterCriteria and SortCriteria objects provided to the TableDataFilter and TableDataSorter instances used by this component. If TableDataFilter and TableDataSorter are modified directly, invoke the clearSort and clearFilter method to clear the previous sort and filter.

Returns:
An array of RowKey objects.

addSort

public void addSort(com.sun.data.provider.SortCriteria criteria)
Add a SortCriteria object to sort.

Note: Objects are sorted in the reverse order they were added. For example, the first object added, will be the last sort applied as the primary sort. The second object added, will be the second to last sort applied as the secondary sort. The third object added, will be the third to last sort applied as the tertiary sort and so on. If an existing SortCriteria object is found with the same FieldKey, the sort order is replaced with the new value. Note that sorts are not actually applied until the getSortedRowKeys() method is invoked, which happens automatically by the renderer.

Note: This method also resets pagination to the first page per UI guidelines.

Parameters:
criteria - The SortCriteria object to sort.

clearSort

public void clearSort()
Clear SortCriteria objects from the TableDataSorter instance used by this component.

Note: This method clears the cached sort, then resets pagination to the first page per UI guidelines.


getSortCount

public int getSortCount()
Get the number of SortCriteria objects to sort.

Returns:
The number of SortCriteria objects to sort.

getSortLevel

public int getSortLevel(com.sun.data.provider.SortCriteria criteria)
Get the level of the given SortCriteria object to sort.

Note: The primary sort is level 1, the secondary sort is level 2, the tertiary sort is level 3, and so on. If the SortCriteria object was not previously added using the addSort method, the level will be returned as -1.

Parameters:
criteria - The SortCriteria object to sort.
Returns:
The sort level or -1 if the SortCriteria object was not previously added.

isDescendingSort

public boolean isDescendingSort(com.sun.data.provider.SortCriteria criteria)
Test if given SortCriteria object is a descending sort.

Parameters:
criteria - The SortCriteria object to sort.
Returns:
true if descending, else false.

getSortedRowKeys

public com.sun.data.provider.RowKey[] getSortedRowKeys()
Get an array containing sorted RowKey objects.

Note: This sort depends on the SortCriteria objects provided to the TableDataSorter instance used by this component. For better performance, this sort also depends on the FilterCriteria objects provided to the TableDataFilter instance used by this component. Due to filtering, the size of the returned array may be less than the total number of RowKey objects for the underlying TableDataProvider.

Note: The returned RowKey objects are cached. If the TableDataSorter and TableDataFilter instances used by this component are modified directly, invoke the clearSort and clearFilter methods to clear the previous sort and filter.

Returns:
An array containing sorted RowKey objects.

getTableDataSorter

public com.sun.data.provider.TableDataSorter getTableDataSorter()
Get the TableDataSorter object used to sort rows.

Overrides:
getTableDataSorter in class TableRowGroupBase
Returns:
The TableDataSorter object used to sort rows.

setTableDataSorter

public void setTableDataSorter(com.sun.data.provider.TableDataSorter sorter)
Set the TableDataSorter object used to sort rows.

Overrides:
setTableDataSorter in class TableRowGroupBase
Parameters:
sorter - The TableDataSorter object used to sort rows.
See Also:
TableRowGroupBase.getTableDataSorter()

setSortCriteria

public void setSortCriteria(com.sun.data.provider.SortCriteria[] sortCriteria)
Set SortCriteria objects for the TableDataSorter instance used by this component.

Note: This method clears the cached sort, then resets pagination to the first page per UI guidelines.

Parameters:
sortCriteria - An array of SortCriteria objects defining the sort order on this TableDataSorter.

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class TableRowGroupBase

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class TableRowGroupBase
Returns:
An array of Object values.

setValueBinding

public void setValueBinding(java.lang.String name,
                            javax.faces.el.ValueBinding binding)
Set the ValueBinding used to calculate the value for the specified attribute or property name, if any. In addition, if a ValueBinding is set for the value property, remove any synthesized TableDataProvider for the data previously bound to this component.

Parameters:
name - Name of the attribute or property for which to set a ValueBinding.
binding - The ValueBinding to set, or null to remove any currently set ValueBinding.
Throws:
java.lang.IllegalArgumentException - If name is one of sourceVar.
java.lang.NullPointerException - If name is null.

getClientId

public java.lang.String getClientId(javax.faces.context.FacesContext context)
Return a client identifier for this component that includes the current value of the RowKey property, if it is not set to null. This implies that multiple calls to getClientId() may return different results, but ensures that child components can themselves generate row-specific client identifiers (since TableRowGroup is a NamingContainer).

Returns:
The client id.
Throws:
java.lang.NullPointerException - if FacesContext is null.

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Override the default UIComponentBase.queueEvent() processing to wrap any queued events in a wrapper so that we can reset the current RowKey in broadcast().

Parameters:
event - FacesEvent to be queued.
Throws:
java.lang.IllegalStateException - If this component is not a descendant of a UIViewRoot.
java.lang.NullPointerException - If FacesEvent is null.

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Override the default UIComponentBase.broadcast() processing to unwrap any wrapped FacesEvent and reset the current RowKey, before the event is actually broadcast. For events that we did not wrap (in queueEvent()), default processing will occur.

Parameters:
event - The FacesEvent to be broadcast.
Throws:
javax.faces.event.AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed.
java.lang.IllegalArgumentException - if the implementation class of this FacesEvent is not supported by this component.
java.lang.NullPointerException - if FacesEvent is null.

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
In addition to the default behavior, ensure that any saved per-row state for our child input components is discarded unless it is needed to rerender the current page with errors.

Parameters:
context - FacesContext for the current request.
Throws:
java.io.IOException - if an input/output error occurs while rendering.
java.lang.NullPointerException - if FacesContext is null.

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Override the default UIComponentBase.processDecodes() processing to perform the following steps.

Parameters:
context - FacesContext for the current request.
Throws:
java.lang.NullPointerException - if FacesContext is null.

processValidators

public void processValidators(javax.faces.context.FacesContext context)
Override the default UIComponentBase.processValidators() processing to perform the following steps.

Parameters:
context - FacesContext for the current request.
Throws:
java.lang.NullPointerException - if FacesContext is null.

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)
Override the default UIComponentBase.processUpdates() processing to perform the following steps.

Parameters:
context - FacesContext for the current request.
Throws:
java.lang.NullPointerException - if FacesContext is null.