com.sun.webui.jsf.component
Class TableRowGroupBase

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.sun.webui.jsf.component.WebuiComponent
              extended by com.sun.webui.jsf.component.TableRowGroupBase
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
TableRowGroup

public abstract class TableRowGroupBase
extends WebuiComponent
implements javax.faces.component.NamingContainer

Base class for table row group components.


Field Summary
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
TableRowGroupBase()
           
 
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 clear()
          Clear cached properties.
 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 getAlign()
          Use the align attribute to specify the horizontal alignment for the content of each cell in the row.
 java.lang.String getBgColor()
          The deprecated BGCOLOR attribute suggests a background color for the row.
 java.lang.String getChar()
          Use the char attribute to specify a character to use for horizontal alignment in each cell in the row.
 java.lang.String getCharOff()
          Use the charOff attribute to specify the offset of the first occurrence of the alignment character that is specified with the char attribute.
 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.
 java.lang.String getEmptyDataMsg()
          The text to be displayed when the table does not contain data.
 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.
 java.lang.String getHeaderText()
          The text to be displayed in the 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.
 java.lang.String getOnClick()
          Scripting code executed when a mouse click occurs over this component.
 java.lang.String getOnDblClick()
          Scripting code executed when a mouse double click occurs over this component.
 java.lang.String getOnKeyDown()
          Scripting code executed when the user presses down on a key while the component has focus.
 java.lang.String getOnKeyPress()
          Scripting code executed when the user presses and releases a key while the component has focus.
 java.lang.String getOnKeyUp()
          Scripting code executed when the user releases a key while the component has focus.
 java.lang.String getOnMouseDown()
          Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
 java.lang.String getOnMouseMove()
          Scripting code executed when the user moves the mouse pointer while over the component.
 java.lang.String getOnMouseOut()
          Scripting code executed when a mouse out movement occurs over this component.
 java.lang.String getOnMouseOver()
          Scripting code executed when the user moves the mouse pointer into the boundary of this component.
 java.lang.String getOnMouseUp()
          Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
 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.
 java.lang.Object getSourceData()
          The sourceData attribute is used to specify the data source to populate the table.
 java.lang.String getSourceVar()
          Use the sourceVar attribute to specify the name of the request-scope attribute under which model data for the current row will be exposed when iterating.
 java.lang.String getStyleClasses()
          Use the styleClasses attribute to specify a list of CSS style classes to apply to the rows of the group.
 java.util.Iterator getTableColumnChildren()
          Get an Iterator over the TableColumnBase 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.
 java.lang.String getToolTip()
          Sets the value of the title attribute for the HTML element.
 java.lang.Class getType(com.sun.data.provider.FieldKey fieldKey)
          Get the data type of the data element referenced by the given FieldKey.
 java.lang.String getValign()
          Use the valign attribute to specify the vertical alignment for the content of each cell in the column.
 boolean invokeOnComponent(javax.faces.context.FacesContext context, java.lang.String clientId, javax.faces.component.ContextCallback callback)
          Override behavior from UIComponentBase to provide special care for positioning the data properly before finding the component and invoking the callback on it.
 boolean isCollapsed()
          Use the collapsed attribute to initially render the group as collapsed, so that the data rows are hidden and only the header row is visible.
 boolean isDescendingSort(com.sun.data.provider.SortCriteria criteria)
          Test if given SortCriteria object is a descending sort.
 boolean isGroupToggleButton()
          Use the groupToggleButton attribute to display a button in the group header to allow users to collapse and expand the group of rows.
 boolean isRowAvailable()
          Get the flag indicating whether there is row data available for the current RowKey.
 boolean isSelected()
          Flag indicating that the current row is selected.
 boolean isSelectMultipleToggleButton()
          Use the selectMultipleToggleButton attribute to display a button in the group header to allow users to select all rows of the group at once.
 boolean isVisible()
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 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 setAlign(java.lang.String align)
          Use the align attribute to specify the horizontal alignment for the content of each cell in the row.
 void setBgColor(java.lang.String bgColor)
          The deprecated BGCOLOR attribute suggests a background color for the row.
 void setChar(java.lang.String _char)
          Use the char attribute to specify a character to use for horizontal alignment in each cell in the row.
 void setCharOff(java.lang.String charOff)
          Use the charOff attribute to specify the offset of the first occurrence of the alignment character that is specified with the char attribute.
 void setCollapsed(boolean collapsed)
          Use the collapsed attribute to initially render the group as collapsed, so that the data rows are hidden and only the header row is visible.
 void setEmptyDataMsg(java.lang.String emptyDataMsg)
          The text to be displayed when the table does not contain data.
 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 setGroupToggleButton(boolean groupToggleButton)
          Use the groupToggleButton attribute to display a button in the group header to allow users to collapse and expand the group of rows.
 void setHeaderText(java.lang.String headerText)
          The text to be displayed in the group header.
 void setOnClick(java.lang.String onClick)
          Scripting code executed when a mouse click occurs over this component.
 void setOnDblClick(java.lang.String onDblClick)
          Scripting code executed when a mouse double click occurs over this component.
 void setOnKeyDown(java.lang.String onKeyDown)
          Scripting code executed when the user presses down on a key while the component has focus.
 void setOnKeyPress(java.lang.String onKeyPress)
          Scripting code executed when the user presses and releases a key while the component has focus.
 void setOnKeyUp(java.lang.String onKeyUp)
          Scripting code executed when the user releases a key while the component has focus.
 void setOnMouseDown(java.lang.String onMouseDown)
          Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
 void setOnMouseMove(java.lang.String onMouseMove)
          Scripting code executed when the user moves the mouse pointer while over the component.
 void setOnMouseOut(java.lang.String onMouseOut)
          Scripting code executed when a mouse out movement occurs over this component.
 void setOnMouseOver(java.lang.String onMouseOver)
          Scripting code executed when the user moves the mouse pointer into the boundary of this component.
 void setOnMouseUp(java.lang.String onMouseUp)
          Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
 void setPage(int page)
          A convenience method to set the current page to be displayed.
 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 setSelected(boolean selected)
          Flag indicating that the current row is selected.
 void setSelectMultipleToggleButton(boolean selectMultipleToggleButton)
          Use the selectMultipleToggleButton attribute to display a button in the group header to allow users to select all rows of the group at once.
 void setSortCriteria(com.sun.data.provider.SortCriteria[] sortCriteria)
          Set SortCriteria objects for the TableDataSorter instance used by this component.
 void setSourceData(java.lang.Object sourceData)
          Set the source data of the TableRowGroupBase.
 void setSourceVar(java.lang.String sourceVar)
          Use the sourceVar attribute to specify the name of the request-scope attribute under which model data for the current row will be exposed when iterating.
 void setStyleClasses(java.lang.String styleClasses)
          Use the styleClasses attribute to specify a list of CSS style classes to apply to the rows of the group.
 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 setToolTip(java.lang.String toolTip)
          Sets the value of the title attribute for the HTML element.
 void setValign(java.lang.String valign)
          Use the valign attribute to specify the vertical alignment for the content of each cell in the column.
 void setValueExpression(java.lang.String name, javax.el.ValueExpression valueExpression)
          Set the ValueExpression used to calculate the value for the specified attribute or property name, if any.
 void setVisible(boolean visible)
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 
Methods inherited from class com.sun.webui.jsf.component.WebuiComponent
setId, setRendered
 
Methods inherited from class javax.faces.component.UIComponentBase
decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, getValueExpression, isRendered, isTransient, processRestoreState, processSaveState, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getFamily
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableRowGroupBase

public TableRowGroupBase()
Method Detail

clear

public void clear()
Clear cached properties.

Note: Properties may have been cached via the apply request values, validate, and update phases and must be re-evaluated during the render response phase (e.g., the underlying DataProvider may have changed). This cannot always be done via encodeBegin because the component's parent may need to obtain updated properties before this component is rendered.


getTableColumnChildren

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

Returns:
An Iterator over the TableColumnBase children.

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.

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.

Parameters:
filter - The TableDataFilter object used to filter rows.

getFirst

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

Note: If rows have been removed from the underlying DataProvider, 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.

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.

Note: This method is used to set the current, first, next, prev, and last pages. For example, you could use setFirst(0) to display the first page and setFirst(getLast()) to display the last page. This method is particularly useful when a subset of data is displayed in scroll mode or when overriding pagination. As a convenience, the setPage(int) method is provided.

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

Warning: When the end user is navigating the web application, use the saveState and restoreState() methods to maintain state. There is much more to state than just the first row (e.g., sorting, filtering, etc.).

Parameters:
first - The first row number.
Throws:
java.lang.IllegalArgumentException - for negative values.

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.

setPage

public void setPage(int page)
A convenience method to set the current page to be displayed.

Note: You can also set the current, first, next, prev, and last pages by invoking the setFirst(int) method directly. For example, you could use setFirst(0) to display the first page and setFirst(getLast()) to display the last page. The setFirst(int) method is particularly useful when a subset of data is displayed in scroll mode or when overriding pagination.

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).

Parameters:
page - The current page.

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.

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.

Parameters:
rows - The number of rows to be displayed for a paginated table.
Throws:
java.lang.IllegalArgumentException - for negative values.

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.

WARNING for ObjectArrayDataProvider: Until you call setArray() or setObjectType with a non-null parameter, or use a constructor variant that accepts an non-null array, no information about field keys will be available. Therefore, any attempt to reference a FieldKey or field identifier in a method call will throw IllegalArgumentException.

WARNING for ObjectListDataProvider: Until you call setList() or setObjectType with a non-null parameter, or use a constructor variant that accepts an non-null non-empty list, no information about field keys will be available. Therefore, any attempt to reference a FieldKey or field identifier in a method call will throw IllegalArgumentException.

Parameters:
fieldId - The id of the requested FieldKey.
Returns:
The RowKey from the underlying TableDataProvider.
Throws:
IllegalArgumentExeption - If object type is not set for ObjectArrayDataProvider or ObjectListDataProvider.

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.

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, TableRowGroupBase must maintain per-row information for each descendant as follows:

To restore current state information for all descendant components, TableRowGroupBase 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(java.lang.Object sourceData)
Set the source data of the TableRowGroupBase.

Note: When ever the underlying DataProvider has changed, 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.

Parameters:
sourceData - The source data of the TableRowGroupBase.

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 (primary sorts only).

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.

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.

Parameters:
sorter - The TableDataSorter object used to sort rows.

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 javax.faces.component.UIComponentBase

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 javax.faces.component.UIComponentBase
Returns:
An array of Object values.

invokeOnComponent

public boolean invokeOnComponent(javax.faces.context.FacesContext context,
                                 java.lang.String clientId,
                                 javax.faces.component.ContextCallback callback)
                          throws javax.faces.FacesException
Override behavior from UIComponentBase to provide special care for positioning the data properly before finding the component and invoking the callback on it. If the argument clientId is equal to this.getClientId() simply invoke the contextCallback , passing the context argument and this as arguments, and return true. Otherwise, attempt to extract a rowId from the clientId. For example, if the argument clientId was form:data:3:customerHeader the rowId would be 3. Let this value be called newRowId. The current rowId of this instance must be saved aside and restored before returning in all cases, regardless of the outcome of the search or if any exceptions are thrown in the process.

The implementation of this method must never return true if setting the rowId of this instance to be equal to newRowId causes this instance to return false from the isRowAvailable method.

Overrides:
invokeOnComponent in class javax.faces.component.UIComponentBase
Throws:
java.lang.NullPointerException
javax.faces.FacesException - Also throws FacesException if any exception is thrown when deriving the rowd from the argument clientId.

setValueExpression

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

Note: When ever the underlying DataProvider has changed, 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:
setValueExpression in class javax.faces.component.UIComponentBase
Parameters:
name - Name of the attribute or property for which to set a ValueExpression.
valueExpression - The ValueExpression to set, or null to remove any currently set ValueExpression.
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 TableRowGroupBase is a NamingContainer).

Overrides:
getClientId in class javax.faces.component.UIComponentBase
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().

Overrides:
queueEvent in class javax.faces.component.UIComponentBase
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.

Overrides:
broadcast in class javax.faces.component.UIComponentBase
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.

Overrides:
encodeBegin in class javax.faces.component.UIComponentBase
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.

Overrides:
processDecodes in class WebuiComponent
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.

Overrides:
processValidators in class WebuiComponent
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.

Overrides:
processUpdates in class WebuiComponent
Parameters:
context - FacesContext for the current request.
Throws:
java.lang.NullPointerException - if FacesContext is null.

getAlign

public java.lang.String getAlign()
Use the align attribute to specify the horizontal alignment for the content of each cell in the row. Valid values are left, center, right, justify, and char. The default alignment is left. Setting the align attribute to char causes the cell's contents to be aligned on the character that you specify with the char attribute. For example, to align cell contents on colons, set align="char" and char=":"


setAlign

public void setAlign(java.lang.String align)
Use the align attribute to specify the horizontal alignment for the content of each cell in the row. Valid values are left, center, right, justify, and char. The default alignment is left. Setting the align attribute to char causes the cell's contents to be aligned on the character that you specify with the char attribute. For example, to align cell contents on colons, set align="char" and char=":"


getBgColor

public java.lang.String getBgColor()
The deprecated BGCOLOR attribute suggests a background color for the row. The combination of this attribute with can leave invisible or unreadable text on Netscape Navigator 2.x, which does not support BGCOLOR on table elements. BGCOLOR is dangerous even on supporting browsers, since most fail to override it when overriding other author-specified colors. Style sheets provide a safer, more flexible method of specifying a row's background color.


setBgColor

public void setBgColor(java.lang.String bgColor)
The deprecated BGCOLOR attribute suggests a background color for the row. The combination of this attribute with can leave invisible or unreadable text on Netscape Navigator 2.x, which does not support BGCOLOR on table elements. BGCOLOR is dangerous even on supporting browsers, since most fail to override it when overriding other author-specified colors. Style sheets provide a safer, more flexible method of specifying a row's background color.


getChar

public java.lang.String getChar()
Use the char attribute to specify a character to use for horizontal alignment in each cell in the row. You must also set the align attribute to char to enable character alignment to be used. The default value for the char attribute is the decimal point of the current language, such as a period in English. The char HTML property is not supported by all browsers.


setChar

public void setChar(java.lang.String _char)
Use the char attribute to specify a character to use for horizontal alignment in each cell in the row. You must also set the align attribute to char to enable character alignment to be used. The default value for the char attribute is the decimal point of the current language, such as a period in English. The char HTML property is not supported by all browsers.


getCharOff

public java.lang.String getCharOff()
Use the charOff attribute to specify the offset of the first occurrence of the alignment character that is specified with the char attribute. The offset is the distance from the left cell border, in locales that read from left to right. The charOff attribute's value can be a number of pixels or a percentage of the cell's width. For example, charOff="50%" centers the alignment character horizontally in a cell. If charOff="25%", the first instance of the alignment character is placed at one fourth of the width of the cell.


setCharOff

public void setCharOff(java.lang.String charOff)
Use the charOff attribute to specify the offset of the first occurrence of the alignment character that is specified with the char attribute. The offset is the distance from the left cell border, in locales that read from left to right. The charOff attribute's value can be a number of pixels or a percentage of the cell's width. For example, charOff="50%" centers the alignment character horizontally in a cell. If charOff="25%", the first instance of the alignment character is placed at one fourth of the width of the cell.


isCollapsed

public boolean isCollapsed()
Use the collapsed attribute to initially render the group as collapsed, so that the data rows are hidden and only the header row is visible. The default is to show the group expanded.


setCollapsed

public void setCollapsed(boolean collapsed)
Use the collapsed attribute to initially render the group as collapsed, so that the data rows are hidden and only the header row is visible. The default is to show the group expanded.


getEmptyDataMsg

public java.lang.String getEmptyDataMsg()
The text to be displayed when the table does not contain data. The text is displayed left-aligned in a single row that contains one cell that spans all columns. The emptyDataMsg text might be something similar to "No items found." If users can add items to the table, the message might include instructions, such as "This table contains no files. To add a file to monitor, click the New button."


setEmptyDataMsg

public void setEmptyDataMsg(java.lang.String emptyDataMsg)
The text to be displayed when the table does not contain data. The text is displayed left-aligned in a single row that contains one cell that spans all columns. The emptyDataMsg text might be something similar to "No items found." If users can add items to the table, the message might include instructions, such as "This table contains no files. To add a file to monitor, click the New button."


isGroupToggleButton

public boolean isGroupToggleButton()
Use the groupToggleButton attribute to display a button in the group header to allow users to collapse and expand the group of rows.


setGroupToggleButton

public void setGroupToggleButton(boolean groupToggleButton)
Use the groupToggleButton attribute to display a button in the group header to allow users to collapse and expand the group of rows.


getHeaderText

public java.lang.String getHeaderText()
The text to be displayed in the group header.


setHeaderText

public void setHeaderText(java.lang.String headerText)
The text to be displayed in the group header.


getOnClick

public java.lang.String getOnClick()
Scripting code executed when a mouse click occurs over this component.


setOnClick

public void setOnClick(java.lang.String onClick)
Scripting code executed when a mouse click occurs over this component.


getOnDblClick

public java.lang.String getOnDblClick()
Scripting code executed when a mouse double click occurs over this component.


setOnDblClick

public void setOnDblClick(java.lang.String onDblClick)
Scripting code executed when a mouse double click occurs over this component.


getOnKeyDown

public java.lang.String getOnKeyDown()
Scripting code executed when the user presses down on a key while the component has focus.


setOnKeyDown

public void setOnKeyDown(java.lang.String onKeyDown)
Scripting code executed when the user presses down on a key while the component has focus.


getOnKeyPress

public java.lang.String getOnKeyPress()
Scripting code executed when the user presses and releases a key while the component has focus.


setOnKeyPress

public void setOnKeyPress(java.lang.String onKeyPress)
Scripting code executed when the user presses and releases a key while the component has focus.


getOnKeyUp

public java.lang.String getOnKeyUp()
Scripting code executed when the user releases a key while the component has focus.


setOnKeyUp

public void setOnKeyUp(java.lang.String onKeyUp)
Scripting code executed when the user releases a key while the component has focus.


getOnMouseDown

public java.lang.String getOnMouseDown()
Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.


setOnMouseDown

public void setOnMouseDown(java.lang.String onMouseDown)
Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.


getOnMouseMove

public java.lang.String getOnMouseMove()
Scripting code executed when the user moves the mouse pointer while over the component.


setOnMouseMove

public void setOnMouseMove(java.lang.String onMouseMove)
Scripting code executed when the user moves the mouse pointer while over the component.


getOnMouseOut

public java.lang.String getOnMouseOut()
Scripting code executed when a mouse out movement occurs over this component.


setOnMouseOut

public void setOnMouseOut(java.lang.String onMouseOut)
Scripting code executed when a mouse out movement occurs over this component.


getOnMouseOver

public java.lang.String getOnMouseOver()
Scripting code executed when the user moves the mouse pointer into the boundary of this component.


setOnMouseOver

public void setOnMouseOver(java.lang.String onMouseOver)
Scripting code executed when the user moves the mouse pointer into the boundary of this component.


getOnMouseUp

public java.lang.String getOnMouseUp()
Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.


setOnMouseUp

public void setOnMouseUp(java.lang.String onMouseUp)
Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.


isSelectMultipleToggleButton

public boolean isSelectMultipleToggleButton()
Use the selectMultipleToggleButton attribute to display a button in the group header to allow users to select all rows of the group at once. The button toggles a column of checkboxes using the id that is given to the selectId attribute of the webuijsf:tableColumn and webuijsf:table2Column tags.


setSelectMultipleToggleButton

public void setSelectMultipleToggleButton(boolean selectMultipleToggleButton)
Use the selectMultipleToggleButton attribute to display a button in the group header to allow users to select all rows of the group at once. The button toggles a column of checkboxes using the id that is given to the selectId attribute of the webuijsf:tableColumn and webuijsf:table2Column tags.


isSelected

public boolean isSelected()
Flag indicating that the current row is selected. If the value is set to true, the row will appear highlighted.


setSelected

public void setSelected(boolean selected)
Flag indicating that the current row is selected. If the value is set to true, the row will appear highlighted.


getSourceData

public java.lang.Object getSourceData()
The sourceData attribute is used to specify the data source to populate the table. The value of the sourceData attribute may be a JavaServer Faces EL expression that resolves to a backing bean of type com.sun.data.provider.TableDataProvider.

The sourceData property is referenced during multiple phases of the JavaServer Faces life cycle while iterating over the rows. The object that is bound to this attribute should be cached so that the object is not created more often than needed.


getSourceVar

public java.lang.String getSourceVar()
Use the sourceVar attribute to specify the name of the request-scope attribute under which model data for the current row will be exposed when iterating. 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 this property. Note: This value must be unique for each table in the JSP page.


setSourceVar

public void setSourceVar(java.lang.String sourceVar)
Use the sourceVar attribute to specify the name of the request-scope attribute under which model data for the current row will be exposed when iterating. 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 this property. Note: This value must be unique for each table in the JSP page.


getStyleClasses

public java.lang.String getStyleClasses()
Use the styleClasses attribute to specify a list of CSS style classes to apply to the rows of the group. You can apply all the styles in the list to each row by separating the class names with commas. Each row looks the same when commas are used to delimit the styles. You can apply alternating styles to individual rows by separating the style class names with spaces. You can create a pattern of shading alternate rows, for example, to improve readability of the table. For example, if the list has two elements, the first style class in the list is applied to the first row, the second class to the second row, the first class to the third row, the second class to the fourth row, etc. The tableRowGroup component iterates through the list of styles and repeats from the beginning until a style is applied to each row.


setStyleClasses

public void setStyleClasses(java.lang.String styleClasses)
Use the styleClasses attribute to specify a list of CSS style classes to apply to the rows of the group. You can apply all the styles in the list to each row by separating the class names with commas. Each row looks the same when commas are used to delimit the styles. You can apply alternating styles to individual rows by separating the style class names with spaces. You can create a pattern of shading alternate rows, for example, to improve readability of the table. For example, if the list has two elements, the first style class in the list is applied to the first row, the second class to the second row, the first class to the third row, the second class to the fourth row, etc. The tableRowGroup component iterates through the list of styles and repeats from the beginning until a style is applied to each row.


getToolTip

public java.lang.String getToolTip()
Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element.


setToolTip

public void setToolTip(java.lang.String toolTip)
Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element.


getValign

public java.lang.String getValign()
Use the valign attribute to specify the vertical alignment for the content of each cell in the column. Valid values are top, middle, bottom, and baseline. The default vertical alignment is middle. Setting the valign attribute to baseline causes the first line of each cell's content to be aligned on the text baseline, the invisible line on which text characters rest.


setValign

public void setValign(java.lang.String valign)
Use the valign attribute to specify the vertical alignment for the content of each cell in the column. Valid values are top, middle, bottom, and baseline. The default vertical alignment is middle. Setting the valign attribute to baseline causes the first line of each cell's content to be aligned on the text baseline, the invisible line on which text characters rest.


isVisible

public boolean isVisible()
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.


setVisible

public void setVisible(boolean visible)
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.



Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.