com.sun.webui.jsf.component
Class Table

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

public class Table
extends TableBase

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.

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

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.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 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 class com.sun.webui.jsf.component.TableBase
ACTIONS_TOP_FACET
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
Table()
          Default constructor
 
Method Summary
 void clear()
          Clear cached properties.
 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 getExtraActionBottomHtml()
          Extra HTML code to be appended to the <td> HTML element that is rendered for the Action Bar (bottom).
 java.lang.String getExtraActionTopHtml()
          Extra HTML code to be appended to the <td> HTML element that is rendered for the Action Bar (top).
 java.lang.String getExtraFooterHtml()
          Extra HTML code to be appended to the <td> HTML element that is rendered for the table footer.
 java.lang.String getExtraPanelHtml()
          Extra HTML code to be appended to the <td> HTML element that is rendered for an embedded panel.
 java.lang.String getExtraTitleHtml()
          Extra HTML code to be appended to the <caption> HTML element that is rendered for the table title.
 java.lang.String getFamily()
          Return the family for this component.
 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.
 java.lang.String getFooterText()
          The text to be displayed in the table footer, which expands across the width of the table.
 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.
 int getTableRowGroupCount()
          Get the number of child TableRowGroup components found for this component that have a rendered property of true.
 boolean isInternalVirtualForm()
          Flag indicating that this component should use a virtual form.
 boolean isPaginationControls()
          Show the table pagination controls, which allow users to change which page is displayed.
 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 setExtraActionBottomHtml(java.lang.String extraActionBottomHtml)
          Extra HTML code to be appended to the <td> HTML element that is rendered for the Action Bar (bottom).
 void setExtraActionTopHtml(java.lang.String extraActionTopHtml)
          Extra HTML code to be appended to the <td> HTML element that is rendered for the Action Bar (top).
 void setExtraFooterHtml(java.lang.String extraFooterHtml)
          Extra HTML code to be appended to the <td> HTML element that is rendered for the table footer.
 void setExtraPanelHtml(java.lang.String extraPanelHtml)
          Extra HTML code to be appended to the <td> HTML element that is rendered for an embedded panel.
 void setExtraTitleHtml(java.lang.String extraTitleHtml)
          Extra HTML code to be appended to the <caption> HTML element that is rendered for the table title.
 void setFooterText(java.lang.String footerText)
          The text to be displayed in the table footer, which expands across the width of the table.
 void setInternalVirtualForm(boolean internalVirtualForm)
          Flag indicating that this component should use a virtual form.
 void setPaginationControls(boolean paginationControls)
          Show the table pagination controls, which allow users to change which page is displayed.
 
Methods inherited from class com.sun.webui.jsf.component.TableBase
getAlign, getBgColor, getBorder, getCellPadding, getCellSpacing, getDeselectMultipleButtonOnClick, getDeselectSingleButtonOnClick, getFilterPanelFocusId, getFilterText, getFrame, getItemsText, getOnClick, getOnDblClick, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getPreferencesPanelFocusId, getRules, getSelectMultipleButtonOnClick, getSortPanelFocusId, getStyle, getStyleClass, getSummary, getTabIndex, getTableRowGroupChildren, getTitle, getToolTip, getWidth, isAugmentTitle, isClearSortButton, isDeselectMultipleButton, isDeselectSingleButton, isHiddenSelectedRows, isLite, isPaginateButton, isSelectMultipleButton, isSortPanelToggleButton, isVisible, setAlign, setAugmentTitle, setBgColor, setBorder, setCellPadding, setCellSpacing, setClearSortButton, setDeselectMultipleButton, setDeselectMultipleButtonOnClick, setDeselectSingleButton, setDeselectSingleButtonOnClick, setFilterId, setFilterPanelFocusId, setFilterText, setFrame, setHiddenSelectedRows, setItemsText, setLite, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setPaginateButton, setPreferencesPanelFocusId, setRules, setSelectMultipleButton, setSelectMultipleButtonOnClick, setSortPanelFocusId, setSortPanelToggleButton, setStyle, setStyleClass, setSummary, setTabIndex, setTitle, setToolTip, setVisible, setWidth
 
Methods inherited from class com.sun.webui.jsf.component.WebuiComponent
processDecodes, processUpdates, processValidators, setId, setRendered
 
Methods inherited from class javax.faces.component.UIComponentBase
broadcast, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, setValueExpression
 
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

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

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

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

Overrides:
clear in class TableBase

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.

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.

getExtraActionBottomHtml

public java.lang.String getExtraActionBottomHtml()
Extra HTML code to be appended to the <td> HTML element that is rendered for the Action Bar (bottom). 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 "style=`myActionBarStyle'".


setExtraActionBottomHtml

public void setExtraActionBottomHtml(java.lang.String extraActionBottomHtml)
Extra HTML code to be appended to the <td> HTML element that is rendered for the Action Bar (bottom). 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 "style=`myActionBarStyle'".


getExtraActionTopHtml

public java.lang.String getExtraActionTopHtml()
Extra HTML code to be appended to the <td> HTML element that is rendered for the Action Bar (top). 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 "style=`myActionBarStyle'".


setExtraActionTopHtml

public void setExtraActionTopHtml(java.lang.String extraActionTopHtml)
Extra HTML code to be appended to the <td> HTML element that is rendered for the Action Bar (top). 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 "style=`myActionBarStyle'".


getExtraFooterHtml

public java.lang.String getExtraFooterHtml()
Extra HTML code to be appended to the <td> HTML element that is rendered for the table 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 <td> HTML element that is rendered for the table 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'".


getExtraPanelHtml

public java.lang.String getExtraPanelHtml()
Extra HTML code to be appended to the <td> HTML element that is rendered for an embedded panel. 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.


setExtraPanelHtml

public void setExtraPanelHtml(java.lang.String extraPanelHtml)
Extra HTML code to be appended to the <td> HTML element that is rendered for an embedded panel. 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.


getExtraTitleHtml

public java.lang.String getExtraTitleHtml()
Extra HTML code to be appended to the <caption> HTML element that is rendered for the table title. Use only code that is valid in an HTML <caption> 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 "style=`myTitleStyle'".


setExtraTitleHtml

public void setExtraTitleHtml(java.lang.String extraTitleHtml)
Extra HTML code to be appended to the <caption> HTML element that is rendered for the table title. Use only code that is valid in an HTML <caption> 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 "style=`myTitleStyle'".


getFooterText

public java.lang.String getFooterText()
The text to be displayed in the table footer, which expands across the width of the table.


setFooterText

public void setFooterText(java.lang.String footerText)
The text to be displayed in the table footer, which expands across the width of the table.


isInternalVirtualForm

public boolean isInternalVirtualForm()
Flag indicating that this component should use a virtual form. A virtual form is equivalent to enclosing the table component in its own HTML form element, separate from other HTML elements on the same page. As an example, consider the case where a required text field and table appear on the same page. If the user clicks on a table sort button, while the required text field has no value, the sort action is never invoked because a value was required and validation failed. Placing the table in a virtual form allows the table sort action to complete because validation for the required text field is not processed. This is similar to using the immediate property of a button, but allows table children to be submitted so that selected checkbox values may be sorted, for example.


setInternalVirtualForm

public void setInternalVirtualForm(boolean internalVirtualForm)
Flag indicating that this component should use a virtual form. A virtual form is equivalent to enclosing the table component in its own HTML form element, separate from other HTML elements on the same page. As an example, consider the case where a required text field and table appear on the same page. If the user clicks on a table sort button, while the required text field has no value, the sort action is never invoked because a value was required and validation failed. Placing the table in a virtual form allows the table sort action to complete because validation for the required text field is not processed. This is similar to using the immediate property of a button, but allows table children to be submitted so that selected checkbox values may be sorted, for example.


isPaginationControls

public boolean isPaginationControls()
Show the table pagination controls, which allow users to change which page is displayed. The controls include an input field for specifying the page number, a Go button to go to the specified page, and buttons for going to the first, last, previous, and next page.


setPaginationControls

public void setPaginationControls(boolean paginationControls)
Show the table pagination controls, which allow users to change which page is displayed. The controls include an input field for specifying the page number, a Go button to go to the specified page, and buttons for going to the first, last, previous, and next page.


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 TableBase

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 TableBase

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

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.


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