|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.component.UIComponent javax.faces.component.UIComponentBase com.sun.rave.web.ui.component.TableRowGroupBase com.sun.rave.web.ui.component.TableRowGroup
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 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 |
public static final java.lang.String COLUMN_FOOTER_BAR_ID
public static final java.lang.String COLUMN_HEADER_BAR_ID
public static final java.lang.String EMPTY_DATA_COLUMN_ID
public static final java.lang.String EMPTY_DATA_COLUMN_FACET
public static final java.lang.String EMPTY_DATA_TEXT_ID
public static final java.lang.String EMPTY_DATA_TEXT_FACET
public static final java.lang.String FOOTER_FACET
public static final java.lang.String GROUP_FOOTER_BAR_ID
public static final java.lang.String GROUP_FOOTER_ID
public static final java.lang.String GROUP_FOOTER_FACET
public static final java.lang.String GROUP_HEADER_BAR_ID
public static final java.lang.String GROUP_HEADER_ID
public static final java.lang.String GROUP_HEADER_FACET
public static final java.lang.String HEADER_FACET
public static final java.lang.String TABLE_COLUMN_FOOTER_BAR_ID
Constructor Detail |
public TableRowGroup()
Method Detail |
public Table getTableAncestor()
public java.util.Iterator getTableColumnChildren()
public int getColumnCount()
public javax.faces.component.UIComponent getEmptyDataColumn()
public javax.faces.component.UIComponent getEmptyDataText()
public javax.faces.component.UIComponent getGroupFooter()
public javax.faces.component.UIComponent getGroupHeader()
public void clearFilter()
Note: This method clears the cached filter and sort, then resets pagination to the first page per UI guidelines.
public com.sun.data.provider.RowKey[] getFilteredRowKeys()
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.
public com.sun.data.provider.TableDataFilter getTableDataFilter()
getTableDataFilter
in class TableRowGroupBase
public void setFilterCriteria(com.sun.data.provider.FilterCriteria[] filterCriteria)
Note: This method clears the cached filter and sort, then resets pagination to the first page per UI guidelines.
filterCriteria
- An array of FilterCriteria objects defining the
filter order on this TableDataFilter.public void setTableDataFilter(com.sun.data.provider.TableDataFilter filter)
setTableDataFilter
in class TableRowGroupBase
filter
- The TableDataFilter object used to filter rows.TableRowGroupBase.getTableDataFilter()
public int getFirst()
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.
getFirst
in class TableRowGroupBase
public void setFirst(int first)
setFirst
in class TableRowGroupBase
first
- The first row number.
java.lang.IllegalArgumentException
- for negative values.TableRowGroupBase.getFirst()
public int getLast()
public int getPage()
Note: The default is 1 when the table is not paginated.
public int getPages()
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.
public boolean isPaginated()
Note: If the paginationControls property of the Table component is true, this property will be initialized as true.
public void setPaginated(boolean paginated)
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.
paginated
- The paginated state of this component.public int getRows()
Note: UI guidelines recommend a default value of 25 rows per page.
getRows
in class TableRowGroupBase
public void setRows(int rows)
setRows
in class TableRowGroupBase
rows
- The number of rows to be displayed for a paginated table.
java.lang.IllegalArgumentException
- for negative values.TableRowGroupBase.getRows()
public boolean isRowAvailable()
public com.sun.data.provider.RowKey[] getHiddenRowKeys()
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.
public com.sun.data.provider.FieldKey getFieldKey(java.lang.String fieldId)
fieldId
- The id of the requested FieldKey.
public int getRowCount()
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.
public com.sun.data.provider.RowKey getRowKey()
public com.sun.data.provider.RowKey[] getRowKeys()
protected com.sun.data.provider.impl.TableRowDataProvider getTableRowDataProvider()
public java.lang.Class getType(com.sun.data.provider.FieldKey fieldKey)
fieldKey
- The FieldKey identifying the data element whose type is
to be returned.
public com.sun.data.provider.RowKey[] getRenderedRowKeys()
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.
public void setRowKey(com.sun.data.provider.RowKey rowKey)
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:
rowKey
- The RowKey associated with the current row or
null for no association.public void setSourceData(com.sun.data.provider.TableDataProvider sourceData)
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.
setSourceData
in class TableRowGroupBase
sourceData
- The source data of the TableRowGroup.TableRowGroupBase.getSourceData()
public int getHiddenSelectedRowsCount()
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.
public com.sun.data.provider.RowKey[] getHiddenSelectedRowKeys()
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.
public int getSelectedRowsCount()
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.
public com.sun.data.provider.RowKey[] getSelectedRowKeys()
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.
public int getRenderedSelectedRowsCount()
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.
public com.sun.data.provider.RowKey[] getRenderedSelectedRowKeys()
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.
public void addSort(com.sun.data.provider.SortCriteria criteria)
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.
criteria
- The SortCriteria object to sort.public void clearSort()
Note: This method clears the cached sort, then resets pagination to the first page per UI guidelines.
public int getSortCount()
public int getSortLevel(com.sun.data.provider.SortCriteria criteria)
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.
criteria
- The SortCriteria object to sort.
public boolean isDescendingSort(com.sun.data.provider.SortCriteria criteria)
criteria
- The SortCriteria object to sort.
public com.sun.data.provider.RowKey[] getSortedRowKeys()
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.
public com.sun.data.provider.TableDataSorter getTableDataSorter()
getTableDataSorter
in class TableRowGroupBase
public void setTableDataSorter(com.sun.data.provider.TableDataSorter sorter)
setTableDataSorter
in class TableRowGroupBase
sorter
- The TableDataSorter object used to sort rows.TableRowGroupBase.getTableDataSorter()
public void setSortCriteria(com.sun.data.provider.SortCriteria[] sortCriteria)
Note: This method clears the cached sort, then resets pagination to the first page per UI guidelines.
sortCriteria
- An array of SortCriteria objects defining the sort
order on this TableDataSorter.public void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class TableRowGroupBase
public java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
saveState
in class TableRowGroupBase
public void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)
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.
java.lang.IllegalArgumentException
- If name is one of sourceVar.
java.lang.NullPointerException
- If name is null.public java.lang.String getClientId(javax.faces.context.FacesContext context)
java.lang.NullPointerException
- if FacesContext is null.public void queueEvent(javax.faces.event.FacesEvent event)
event
- FacesEvent to be queued.
java.lang.IllegalStateException
- If this component is not a descendant
of a UIViewRoot.
java.lang.NullPointerException
- If FacesEvent is null.public void broadcast(javax.faces.event.FacesEvent event) throws javax.faces.event.AbortProcessingException
event
- The FacesEvent to be broadcast.
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.public void encodeBegin(javax.faces.context.FacesContext context) throws java.io.IOException
context
- FacesContext for the current request.
java.io.IOException
- if an input/output error occurs while rendering.
java.lang.NullPointerException
- if FacesContext is null.public void processDecodes(javax.faces.context.FacesContext context)
context
- FacesContext for the current request.
java.lang.NullPointerException
- if FacesContext is null.public void processValidators(javax.faces.context.FacesContext context)
context
- FacesContext for the current request.
java.lang.NullPointerException
- if FacesContext is null.public void processUpdates(javax.faces.context.FacesContext context)
context
- FacesContext for the current request.
java.lang.NullPointerException
- if FacesContext is null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |