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

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

public class Table
extends TableBase
implements javax.faces.component.NamingContainer

Component that represents a table. The table component provides a layout mechanism for displaying table actions. 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.

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.Table.level = FINE
 

See TLD docs for more information.


Field Summary
static java.lang.String ACTIONS_BOTTOM_FACET
          The facet name for the bottom actions area.
static java.lang.String ACTIONS_TOP_FACET
          The facet name for top actions area.
static java.lang.String CUSTOM_FILTER
          The value for the custom filter option.
static java.lang.String CUSTOM_FILTER_APPLIED
          The value for the custom filter applied option.
static java.lang.String EMBEDDED_PANELS_BAR_ID
          The id for the embedded panels bar.
static java.lang.String EMBEDDED_PANELS_FACET
          The facet name for embedded panels.
static java.lang.String EMBEDDED_PANELS_ID
          The component id for embedded panels.
static java.lang.String FILTER_FACET
          The facet name for the filter area.
static java.lang.String FILTER_PANEL_FACET
          The facet name for the filter panel.
static java.lang.String FOOTER_FACET
          The facet name for the footer area.
static java.lang.String PREFERENCES_PANEL_FACET
          The facet name for the preferences panel.
static java.lang.String SORT_PANEL_FACET
          The facet name for the sort panel.
static java.lang.String TABLE_ACTIONS_BOTTOM_BAR_ID
          The id for the bottom actions bar.
static java.lang.String TABLE_ACTIONS_BOTTOM_FACET
          The facet name for bottom actions.
static java.lang.String TABLE_ACTIONS_BOTTOM_ID
          The component id for bottom actions.
static java.lang.String TABLE_ACTIONS_TOP_BAR_ID
          The id for the top actions bar.
static java.lang.String TABLE_ACTIONS_TOP_FACET
          The facet name for top actions.
static java.lang.String TABLE_ACTIONS_TOP_ID
          The component id for top actions.
static java.lang.String TABLE_FOOTER_BAR_ID
          The id for the table footer.
static java.lang.String TABLE_FOOTER_FACET
          The facet name for the table footer.
static java.lang.String TABLE_FOOTER_ID
          The component id for the table footer.
static java.lang.String TABLE_ID
          The id for the table.
static java.lang.String TITLE_BAR_ID
          The id for the title bar.
static java.lang.String TITLE_FACET
          The facet name for the title area.
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
Table()
          Default constructor
 
Method Summary
 void encodeBegin(javax.faces.context.FacesContext context)
          If the rendered property is true, render the begining of the current state of this UIComponent to the response contained in the specified FacesContext.
 int getColumnCount()
          Get the max number of columns found for all TableRowGroup children.
 int getColumnHeadersCount()
          Get the number of column header bars for all TableRowGroup children.
 javax.faces.component.UIComponent getEmbeddedPanels()
          Get embedded panels.
 java.lang.String getFilterId()
          Get the HTML element ID of the dropDown component used to display table filter options.
static Option[] getFilterOptions(Option[] options, boolean customFilterApplied)
          Get the "custom filter" options used for a table filter menu.
 int getFirst()
          Get the zero-relative row number of the first row to be displayed for a paginated table for all TableRowGroup children.
 int getHiddenSelectedRowsCount()
          Get the number of hidden selected rows for all TableRowGroup children.
 int getPageCount()
          Get the max number of pages for all TableRowGroup children.
 int getRowCount()
          Get the number of rows in the underlying TableDataProvider for all TableRowGroup children.
 int getRows()
          Get the number of rows to be displayed per page for a paginated table for all TableRowGroup children.
 javax.faces.component.UIComponent getTableActionsBottom()
          Get bottom actions.
 javax.faces.component.UIComponent getTableActionsTop()
          Get top actions.
 int getTableColumnFootersCount()
          Get the number of table column footer bars for all TableRowGroup children.
 javax.faces.component.UIComponent getTableFooter()
          Get table footer.
 TableRowGroup getTableRowGroupChild()
          Get the first TableRowGroup child found for the specified component that have a rendered property of true.
 java.util.Iterator getTableRowGroupChildren()
          Get an Iterator over the TableRowGroup children found for this component.
 int getTableRowGroupCount()
          Get the number of child TableRowGroup components found for this component that have a rendered property of true.
 
Methods inherited from class com.sun.rave.web.ui.component.TableBase
getAlign, getBgColor, getBorder, getCellPadding, getCellSpacing, getDeselectMultipleButtonOnClick, getDeselectSingleButtonOnClick, getExtraActionBottomHtml, getExtraActionTopHtml, getExtraFooterHtml, getExtraPanelHtml, getExtraTitleHtml, getFamily, getFilterPanelFocusId, getFilterText, getFooterText, getFrame, getItemsText, getOnClick, getOnDblClick, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getPreferencesPanelFocusId, getRules, getSelectMultipleButtonOnClick, getSortPanelFocusId, getStyle, getStyleClass, getSummary, getTabIndex, getTitle, getToolTip, getWidth, isAugmentTitle, isClearSortButton, isDeselectMultipleButton, isDeselectSingleButton, isHiddenSelectedRows, isInternalVirtualForm, isLite, isPaginateButton, isPaginationControls, isSelectMultipleButton, isSortPanelToggleButton, isVisible, restoreState, saveState, setAlign, setAugmentTitle, setBgColor, setBorder, setCellPadding, setCellSpacing, setClearSortButton, setDeselectMultipleButton, setDeselectMultipleButtonOnClick, setDeselectSingleButton, setDeselectSingleButtonOnClick, setExtraActionBottomHtml, setExtraActionTopHtml, setExtraFooterHtml, setExtraPanelHtml, setExtraTitleHtml, setFilterId, setFilterPanelFocusId, setFilterText, setFooterText, setFrame, setHiddenSelectedRows, setInternalVirtualForm, setItemsText, setLite, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setPaginateButton, setPaginationControls, setPreferencesPanelFocusId, setRules, setSelectMultipleButton, setSelectMultipleButtonOnClick, setSortPanelFocusId, setSortPanelToggleButton, setStyle, setStyleClass, setSummary, setTabIndex, setTitle, setToolTip, setVisible, setWidth
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIONS_BOTTOM_FACET

public static final java.lang.String ACTIONS_BOTTOM_FACET
The facet name for the bottom actions area.

See Also:
Constant Field Values

ACTIONS_TOP_FACET

public static final java.lang.String ACTIONS_TOP_FACET
The facet name for top actions area.

See Also:
Constant Field Values

CUSTOM_FILTER

public static final java.lang.String CUSTOM_FILTER
The value for the custom filter option.

See Also:
Constant Field Values

CUSTOM_FILTER_APPLIED

public static final java.lang.String CUSTOM_FILTER_APPLIED
The value for the custom filter applied option.

See Also:
Constant Field Values

EMBEDDED_PANELS_BAR_ID

public static final java.lang.String EMBEDDED_PANELS_BAR_ID
The id for the embedded panels bar.

See Also:
Constant Field Values

EMBEDDED_PANELS_ID

public static final java.lang.String EMBEDDED_PANELS_ID
The component id for embedded panels.

See Also:
Constant Field Values

EMBEDDED_PANELS_FACET

public static final java.lang.String EMBEDDED_PANELS_FACET
The facet name for embedded panels.

See Also:
Constant Field Values

FILTER_FACET

public static final java.lang.String FILTER_FACET
The facet name for the filter area.

See Also:
Constant Field Values

FILTER_PANEL_FACET

public static final java.lang.String FILTER_PANEL_FACET
The facet name for the filter panel.

See Also:
Constant Field Values

FOOTER_FACET

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

See Also:
Constant Field Values

PREFERENCES_PANEL_FACET

public static final java.lang.String PREFERENCES_PANEL_FACET
The facet name for the preferences panel.

See Also:
Constant Field Values

SORT_PANEL_FACET

public static final java.lang.String SORT_PANEL_FACET
The facet name for the sort panel.

See Also:
Constant Field Values

TABLE_ID

public static final java.lang.String TABLE_ID
The id for the table.

See Also:
Constant Field Values

TABLE_ACTIONS_BOTTOM_BAR_ID

public static final java.lang.String TABLE_ACTIONS_BOTTOM_BAR_ID
The id for the bottom actions bar.

See Also:
Constant Field Values

TABLE_ACTIONS_BOTTOM_ID

public static final java.lang.String TABLE_ACTIONS_BOTTOM_ID
The component id for bottom actions.

See Also:
Constant Field Values

TABLE_ACTIONS_BOTTOM_FACET

public static final java.lang.String TABLE_ACTIONS_BOTTOM_FACET
The facet name for bottom actions.

See Also:
Constant Field Values

TABLE_ACTIONS_TOP_BAR_ID

public static final java.lang.String TABLE_ACTIONS_TOP_BAR_ID
The id for the top actions bar.

See Also:
Constant Field Values

TABLE_ACTIONS_TOP_ID

public static final java.lang.String TABLE_ACTIONS_TOP_ID
The component id for top actions.

See Also:
Constant Field Values

TABLE_ACTIONS_TOP_FACET

public static final java.lang.String TABLE_ACTIONS_TOP_FACET
The facet name for top actions.

See Also:
Constant Field Values

TABLE_FOOTER_BAR_ID

public static final java.lang.String TABLE_FOOTER_BAR_ID
The id for the table footer.

See Also:
Constant Field Values

TABLE_FOOTER_ID

public static final java.lang.String TABLE_FOOTER_ID
The component id for the table footer.

See Also:
Constant Field Values

TABLE_FOOTER_FACET

public static final java.lang.String TABLE_FOOTER_FACET
The facet name for the table footer.

See Also:
Constant Field Values

TITLE_BAR_ID

public static final java.lang.String TITLE_BAR_ID
The id for the title bar.

See Also:
Constant Field Values

TITLE_FACET

public static final java.lang.String TITLE_FACET
The facet name for the title area.

See Also:
Constant Field Values
Constructor Detail

Table

public Table()
Default constructor

Method Detail

getColumnHeadersCount

public int getColumnHeadersCount()
Get the number of column header bars for all TableRowGroup children.

Returns:
The number of column headers.

getHiddenSelectedRowsCount

public int getHiddenSelectedRowsCount()
Get the number of hidden selected rows for all TableRowGroup children.

Returns:
The number of hidden selected rows.

getFirst

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

Returns:
The first row to be displayed.

getPageCount

public int getPageCount()
Get the max number of pages for all TableRowGroup children.

Returns:
The max number of pages.

getRows

public int getRows()
Get the number of rows to be displayed per page for a paginated table for all TableRowGroup children.

Returns:
The number of rows to be displayed per page for a paginated table.

getRowCount

public int getRowCount()
Get the number of rows in the underlying TableDataProvider for all TableRowGroup children.

Returns:
The number of rows.

getColumnCount

public int getColumnCount()
Get the max number of columns found for all TableRowGroup children.

Returns:
The max number of columns.

getTableColumnFootersCount

public int getTableColumnFootersCount()
Get the number of table column footer bars for all TableRowGroup children.

Returns:
The number of table column footers.

getTableRowGroupChild

public TableRowGroup getTableRowGroupChild()
Get the first TableRowGroup child found for the specified component that have a rendered property of true.

Returns:
The first TableRowGroup child found.

getTableRowGroupChildren

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

Returns:
An Iterator over the TableRowGroup children.

getTableRowGroupCount

public int getTableRowGroupCount()
Get the number of child TableRowGroup components found for this component that have a rendered property of true.

Returns:
The number of TableRowGroup children.

getTableActionsBottom

public javax.faces.component.UIComponent getTableActionsBottom()
Get bottom actions.

Returns:
The bottom actions.

getTableActionsTop

public javax.faces.component.UIComponent getTableActionsTop()
Get top actions.

Returns:
The top actions.

getFilterId

public java.lang.String getFilterId()
Get the HTML element ID of the dropDown component used to display table filter options.

Note: This is the fully qualified ID rendered in the outter tag enclosing the HTML element. Required for Javascript functions to set the dropDown styles when the embedded filter panel is opened and to reset the default selected value when the panel is closed.

Overrides:
getFilterId in class TableBase
Returns:
The HTML element ID of the filter menu.

getFilterOptions

public static Option[] getFilterOptions(Option[] options,
                                        boolean customFilterApplied)
Get the "custom filter" options used for a table filter menu.

Note: UI guidelines state that a "Custom Filter" option should be added to the filter menu, used to open the table filter panel. Thus, if the CUSTOM_FILTER option is selected, Javascript invoked via the onChange event will open the table filter panel.

UI guidelines also state that a "Custom Filter Applied" option should be added to the filter menu, indicating that a custom filter has been applied. In this scenario, set the selected property of the filter menu as CUSTOM_FILTER_APPLIED. This selection should persist until another menu option has been selected.

Parameters:
options - An array of options to append to -- may be null.
customFilterApplied - Flag indicating custom filter is applied.
Returns:
A new array containing appended "custom filter" options.

getTableFooter

public javax.faces.component.UIComponent getTableFooter()
Get table footer.

Returns:
The table footer.

getEmbeddedPanels

public javax.faces.component.UIComponent getEmbeddedPanels()
Get embedded panels.

Returns:
The embedded panels.

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
If the rendered property is true, render the begining of the current state of this UIComponent to the response contained in the specified FacesContext. If a Renderer is associated with this UIComponent, the actual encoding will be delegated to Renderer.encodeBegin(FacesContext, UIComponent).

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.