com.sun.webui.jsf.component
Class TableRowGroup

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
                  extended by com.sun.webui.jsf.component.TableRowGroup
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder

public class TableRowGroup
extends TableRowGroupBase

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.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 clear()
          Clear cached properties.
 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.
 java.lang.String getExtraFooterHtml()
          Extra HTML code to be appended to the <tr> HTML element that is rendered for the group footer.
 java.lang.String getExtraHeaderHtml()
          Extra HTML code to be appended to the <tr> HTML element that is rendered for the group header.
 java.lang.String getFamily()
          Return the family for this component.
 int getFirst()
          Get the zero-relative row number of the first row to be displayed for a paginated table.
 java.lang.String getFooterText()
          The text to be displayed in the group footer.
 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.
 int getPage()
          Get current page number 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.
 int getRows()
          Get the number of rows to be displayed for a paginated table.
 Table getTableAncestor()
          Get the closest Table ancestor that encloses this component.
 boolean isAboveColumnFooter()
          Set the aboveColumnFooter attribute to true to display the group footer bar above the column footers bar.
 boolean isAboveColumnHeader()
          Set the aboveColumnHeader attribute to true to display the group header bar above the column headers bar.
 boolean isMultipleColumnFooters()
          Use the multipleColumnFooters attribute when the webuijsf:tableRowGroup contains nested webuijsf:tableColumn tags, and you want the footers of all the webuijsf:tableColumn tags to be shown.
 boolean isMultipleTableColumnFooters()
          Use the multipleTableColumnFooters attribute when the webuijsf:tableRowGroup contains nested webuijsf:tableColumn tags, and you want the table footers of all the webuijsf:tableColumn tags to be shown.
 boolean isPaginated()
          Test the paginated state of this component.
 void processUpdates(javax.faces.context.FacesContext context)
          Override the default UIComponentBase.processUpdates() processing to perform the following steps.
 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 setAboveColumnFooter(boolean aboveColumnFooter)
          Set the aboveColumnFooter attribute to true to display the group footer bar above the column footers bar.
 void setAboveColumnHeader(boolean aboveColumnHeader)
          Set the aboveColumnHeader attribute to true to display the group header bar above the column headers bar.
 void setExtraFooterHtml(java.lang.String extraFooterHtml)
          Extra HTML code to be appended to the <tr> HTML element that is rendered for the group footer.
 void setExtraHeaderHtml(java.lang.String extraHeaderHtml)
          Extra HTML code to be appended to the <tr> HTML element that is rendered for the group header.
 void setFooterText(java.lang.String footerText)
          The text to be displayed in the group footer.
 void setMultipleColumnFooters(boolean multipleColumnFooters)
          Use the multipleColumnFooters attribute when the webuijsf:tableRowGroup contains nested webuijsf:tableColumn tags, and you want the footers of all the webuijsf:tableColumn tags to be shown.
 void setMultipleTableColumnFooters(boolean multipleTableColumnFooters)
          Use the multipleTableColumnFooters attribute when the webuijsf:tableRowGroup contains nested webuijsf:tableColumn tags, and you want the table footers of all the webuijsf:tableColumn tags to be shown.
 void setPaginated(boolean paginated)
          Set the paginated state of this component.
 
Methods inherited from class com.sun.webui.jsf.component.TableRowGroupBase
addSort, broadcast, clearFilter, clearSort, encodeBegin, getAlign, getBgColor, getChar, getCharOff, getClientId, getEmptyDataMsg, getFieldKey, getFilteredRowKeys, getHeaderText, getHiddenSelectedRowKeys, getHiddenSelectedRowsCount, getLast, getOnClick, getOnDblClick, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getPages, getRenderedSelectedRowKeys, getRenderedSelectedRowsCount, getRowCount, getRowKey, getRowKeys, getSelectedRowKeys, getSelectedRowsCount, getSortCount, getSortedRowKeys, getSortLevel, getSourceData, getSourceVar, getStyleClasses, getTableColumnChildren, getTableDataFilter, getTableDataSorter, getToolTip, getType, getValign, invokeOnComponent, isCollapsed, isDescendingSort, isGroupToggleButton, isRowAvailable, isSelected, isSelectMultipleToggleButton, isVisible, processDecodes, processValidators, queueEvent, setAlign, setBgColor, setChar, setCharOff, setCollapsed, setEmptyDataMsg, setFilterCriteria, setFirst, setGroupToggleButton, setHeaderText, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setPage, setRowKey, setRows, setSelected, setSelectMultipleToggleButton, setSortCriteria, setSourceData, setSourceVar, setStyleClasses, setTableDataFilter, setTableDataSorter, setToolTip, setValign, setValueExpression, setVisible
 
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
 
Methods inherited from class java.lang.Object
equals, 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

getFamily

public java.lang.String getFamily()
Return the family for this component.

Specified by:
getFamily in class javax.faces.component.UIComponent

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.

Overrides:
clear in class TableRowGroupBase

getTableAncestor

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

Returns:
The Table ancestor.

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.

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.

Overrides:
getFirst in class TableRowGroupBase
Returns:
The zero-relative row number of the first row 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.

Overrides:
getPage in class TableRowGroupBase
Returns:
The current page number 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.

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.

Overrides:
getHiddenRowKeys in class TableRowGroupBase
Returns:
An array of RowKey objects.

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.

Overrides:
getRenderedRowKeys in class TableRowGroupBase
Returns:
An array of RowKey objects.

processUpdates

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

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

isAboveColumnFooter

public boolean isAboveColumnFooter()
Set the aboveColumnFooter attribute to true to display the group footer bar above the column footers bar. The default is to display the group footer below the column footers.


setAboveColumnFooter

public void setAboveColumnFooter(boolean aboveColumnFooter)
Set the aboveColumnFooter attribute to true to display the group footer bar above the column footers bar. The default is to display the group footer below the column footers.


isAboveColumnHeader

public boolean isAboveColumnHeader()
Set the aboveColumnHeader attribute to true to display the group header bar above the column headers bar. The default is to display the group header below the column headers.


setAboveColumnHeader

public void setAboveColumnHeader(boolean aboveColumnHeader)
Set the aboveColumnHeader attribute to true to display the group header bar above the column headers bar. The default is to display the group header below the column headers.


getExtraFooterHtml

public java.lang.String getExtraFooterHtml()
Extra HTML code to be appended to the <tr> HTML element that is rendered for the group footer. Use only code that is valid in an HTML <td> element. The code you specify is inserted in the HTML element, and is not checked for validity. For example, you might set this attribute to "nowrap=`nowrap'".


setExtraFooterHtml

public void setExtraFooterHtml(java.lang.String extraFooterHtml)
Extra HTML code to be appended to the <tr> HTML element that is rendered for the group footer. Use only code that is valid in an HTML <td> element. The code you specify is inserted in the HTML element, and is not checked for validity. For example, you might set this attribute to "nowrap=`nowrap'".


getExtraHeaderHtml

public java.lang.String getExtraHeaderHtml()
Extra HTML code to be appended to the <tr> HTML element that is rendered for the group header. Use only code that is valid in an HTML <td> element. The code you specify is inserted in the HTML element, and is not checked for validity. For example, you might set this attribute to "nowrap=`nowrap'".


setExtraHeaderHtml

public void setExtraHeaderHtml(java.lang.String extraHeaderHtml)
Extra HTML code to be appended to the <tr> HTML element that is rendered for the group header. Use only code that is valid in an HTML <td> element. The code you specify is inserted in the HTML element, and is not checked for validity. For example, you might set this attribute to "nowrap=`nowrap'".


getFooterText

public java.lang.String getFooterText()
The text to be displayed in the group footer.


setFooterText

public void setFooterText(java.lang.String footerText)
The text to be displayed in the group footer.


isMultipleColumnFooters

public boolean isMultipleColumnFooters()
Use the multipleColumnFooters attribute when the webuijsf:tableRowGroup contains nested webuijsf:tableColumn tags, and you want the footers of all the webuijsf:tableColumn tags to be shown. The default is to show the footers of only the innermost level of nested webuijsf:tableColumn tags.


setMultipleColumnFooters

public void setMultipleColumnFooters(boolean multipleColumnFooters)
Use the multipleColumnFooters attribute when the webuijsf:tableRowGroup contains nested webuijsf:tableColumn tags, and you want the footers of all the webuijsf:tableColumn tags to be shown. The default is to show the footers of only the innermost level of nested webuijsf:tableColumn tags.


isMultipleTableColumnFooters

public boolean isMultipleTableColumnFooters()
Use the multipleTableColumnFooters attribute when the webuijsf:tableRowGroup contains nested webuijsf:tableColumn tags, and you want the table footers of all the webuijsf:tableColumn tags to be shown. The default is to show the table footers of only the innermost level of nested webuijsf:tableColumn tags.


setMultipleTableColumnFooters

public void setMultipleTableColumnFooters(boolean multipleTableColumnFooters)
Use the multipleTableColumnFooters attribute when the webuijsf:tableRowGroup contains nested webuijsf:tableColumn tags, and you want the table footers of all the webuijsf:tableColumn tags to be shown. The default is to show the table footers of only the innermost level of nested webuijsf:tableColumn tags.


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.


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