org.apache.myfaces.component.html.ext
Class HtmlDataTable

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIData
              extended by javax.faces.component.html.HtmlDataTable
                  extended by org.apache.myfaces.component.html.ext.HtmlDataTableHack
                      extended by org.apache.myfaces.component.html.ext.AbstractHtmlDataTable
                          extended by org.apache.myfaces.component.html.ext.HtmlDataTable
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder, NewspaperTable, UserRoleAware, ExtendedComponentBase

public class HtmlDataTable
extends AbstractHtmlDataTable


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String DEFAULT_RENDERER_TYPE
           
 
Fields inherited from class org.apache.myfaces.component.html.ext.AbstractHtmlDataTable
DETAIL_STAMP_FACET_NAME, NEWSPAPER_COLUMNS_PROPERTY, NEWSPAPER_ORIENTATION_PROPERTY, SPACER_FACET_NAME
 
Fields inherited from interface org.apache.myfaces.component.UserRoleAware
ENABLED_ON_USER_ROLE_ATTR, VISIBLE_ON_USER_ROLE_ATTR
 
Fields inherited from interface org.apache.myfaces.component.NewspaperTable
NEWSPAPER_HORIZONTAL_ORIENTATION
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
HtmlDataTable()
           
 
Method Summary
 java.lang.String getAlign()
          HTML: Specifies the horizontal alignment of this element.
 java.lang.String getBodyStyle()
          Corresponds to the HTML style attribute for the table body tag
 java.lang.String getBodyStyleClass()
          Corresponds to the HTML class attribute for the table body tag.
 java.lang.String getDatafld()
          Reserved for future use.
 java.lang.String getDataformatas()
          Reserved for future use.
 java.lang.String getDatasrc()
          Reserved for future use.
 java.lang.String getDetailStampLocation()
          before|after - where to render the detailStamp, before the actual row or after it.
 java.lang.String getEnabledOnUserRole()
          If user is in given role, this component will be rendered normally.
 java.lang.String getFamily()
           
 int getNewspaperColumns()
          The number of columns to wrap the table over.
 java.lang.String getNewspaperOrientation()
          The orientation of the newspaper columns in the newspaper table - "horizontal" or "vertical".
 java.lang.String getPreviousRowDataVar()
          A parameter name, under which the previous RowData Object is set in request scope similar to the rowIndexVar and rowCountVar parameters.
 java.lang.String getRowCountVar()
          A parameter name, under which the rowCount is set in request scope similar to the var parameter.
 java.lang.String getRowGroupStyle()
          Corresponds to the HTML style attribute for grouped rows.
 java.lang.String getRowGroupStyleClass()
          StyleClass for grouped rows.
 java.lang.String getRowId()
          The id to use for
 java.lang.String getRowIndexVar()
          A parameter name, under which the current rowIndex is set in request scope similar to the var parameter.
 java.lang.String getRowOnClick()
          Defines a JavaScript onclick event handler for each table row
 java.lang.String getRowOnDblClick()
          Defines a JavaScript ondblclick event handler for each table row
 java.lang.String getRowOnKeyDown()
          Defines a JavaScript onkeydown event handler for each table row
 java.lang.String getRowOnKeyPress()
          Defines a JavaScript onkeypress event handler for each table row
 java.lang.String getRowOnKeyUp()
          Defines a JavaScript onkeyup event handler for each table row
 java.lang.String getRowOnMouseDown()
          Defines a JavaScript onmpusedown event handler for each table row
 java.lang.String getRowOnMouseMove()
          Defines a JavaScript onmousemove event handler for each table row
 java.lang.String getRowOnMouseOut()
          Defines a JavaScript onmouseout event handler for each table row
 java.lang.String getRowOnMouseOver()
          Defines a JavaScript onmouseover event handler for each table row
 java.lang.String getRowOnMouseUp()
          Defines a JavaScript onmouseup event handler for each table row
 java.lang.String getSortedColumnVar()
          A parameter name, under which the a boolean is set in request scope similar to the var parameter.
 java.lang.String getValueType()
          Indicate the expected type of the EL expression pointed by value property.
 java.lang.String getVisibleOnUserRole()
          If user is in given role, this component will be rendered normally.
 boolean isDetailStampExpandedDefault()
          true|false - true if the detailStamp should be expanded by default.
 boolean isEmbedded()
          Avoids rendering the html table tags, thus, giving you a table rendering just rows.
 boolean isRenderedIfEmpty()
          Indicates whether this table should be rendered if the underlying DataModel is empty.
 boolean isSortable()
          Define if the table is sortable or not
 void restoreState(javax.faces.context.FacesContext facesContext, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
           
 void setAlign(java.lang.String align)
           
 void setBodyStyle(java.lang.String bodyStyle)
           
 void setBodyStyleClass(java.lang.String bodyStyleClass)
           
 void setDatafld(java.lang.String datafld)
           
 void setDataformatas(java.lang.String dataformatas)
           
 void setDatasrc(java.lang.String datasrc)
           
 void setDetailStampExpandedDefault(boolean detailStampExpandedDefault)
           
 void setDetailStampLocation(java.lang.String detailStampLocation)
           
 void setEmbedded(boolean embedded)
           
 void setEnabledOnUserRole(java.lang.String enabledOnUserRole)
           
 void setNewspaperColumns(int newspaperColumns)
           
 void setNewspaperOrientation(java.lang.String newspaperOrientation)
           
 void setPreviousRowDataVar(java.lang.String previousRowDataVar)
           
 void setRenderedIfEmpty(boolean renderedIfEmpty)
           
 void setRowCountVar(java.lang.String rowCountVar)
           
 void setRowGroupStyle(java.lang.String rowGroupStyle)
           
 void setRowGroupStyleClass(java.lang.String rowGroupStyleClass)
           
 void setRowId(java.lang.String rowId)
           
 void setRowIndexVar(java.lang.String rowIndexVar)
           
 void setRowOnClick(java.lang.String rowOnClick)
           
 void setRowOnDblClick(java.lang.String rowOnDblClick)
           
 void setRowOnKeyDown(java.lang.String rowOnKeyDown)
           
 void setRowOnKeyPress(java.lang.String rowOnKeyPress)
           
 void setRowOnKeyUp(java.lang.String rowOnKeyUp)
           
 void setRowOnMouseDown(java.lang.String rowOnMouseDown)
           
 void setRowOnMouseMove(java.lang.String rowOnMouseMove)
           
 void setRowOnMouseOut(java.lang.String rowOnMouseOut)
           
 void setRowOnMouseOver(java.lang.String rowOnMouseOver)
           
 void setRowOnMouseUp(java.lang.String rowOnMouseUp)
           
 void setSortable(boolean sortable)
           
 void setSortedColumnVar(java.lang.String sortedColumnVar)
           
 void setValueType(java.lang.String valueType)
           
 void setVisibleOnUserRole(java.lang.String visibleOnUserRole)
           
 
Methods inherited from class org.apache.myfaces.component.html.ext.AbstractHtmlDataTable
collapseAllDetails, columnNameToIndex, createDataModel, createSortHeaderComponent, encodeBegin, encodeEnd, expandAllDetails, findComponent, getClientId, getDataModel, getDetailStamp, getFirst, getForceIdIndexFormula, getPreservedDataModel, getRows, getRowStyle, getRowStyleClass, getSerializableDataModel, getSortColumn, getSortColumnIndex, getSortProperty, getSortPropertyFromEL, getSpacer, getTableContext, getVarDetailToggler, isCurrentDetailExpanded, isDetailExpanded, isExpandedEmpty, isPreserveDataModel, isPreserveSort, isRendered, isSortAscending, isSortHeaderNeeded, isValidChildren, processDecodes, processUpdates, processValidators, restoreDescendantComponentStates, saveDescendantComponentStates, setDetailStamp, setExpandedEmpty, setFirst, setForceIdIndexFormula, setIsValidChildren, setPreserveDataModel, setPreservedDataModel, setPreserveSort, setRowIndex, setRows, setRowStyle, setRowStyleClass, setSortAscending, setSortColumn, setSortColumnIndex, setSortProperty, setSpacer, setVarDetailToggler, toggleDetail
 
Methods inherited from class org.apache.myfaces.component.html.ext.HtmlDataTableHack
checkUpdateModelError, clearRowStates, deleteRowStateForRow, getDerivedRowKeyPrefix, getDerivedSubClientId, getRowCount, getRowData, getRowIndex, getRowKey, hasErrorMessages, isForceId, isForceIdIndex, isPreserveRowStates, isRowAvailable, restoreDescendantComponentStates, saveDescendantComponentStates, setDataModel, setDerivedRowKeyPrefix, setForceId, setForceIdIndex, setPreserveRowStates, setRowKey, setValue, setValueBinding
 
Methods inherited from class javax.faces.component.html.HtmlDataTable
getBgcolor, getBorder, getCellpadding, getCellspacing, getColumnClasses, getDir, getFooterClass, getFrame, getHeaderClass, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getRowClasses, getRules, getStyle, getStyleClass, getSummary, getTitle, getWidth, setBgcolor, setBorder, setCellpadding, setCellspacing, setColumnClasses, setDir, setFooterClass, setFrame, setHeaderClass, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setRowClasses, setRules, setStyle, setStyleClass, setSummary, setTitle, setWidth
 
Methods inherited from class javax.faces.component.UIData
broadcast, getFooter, getHeader, getValue, getVar, queueEvent, setFooter, setHeader, setVar
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeChildren, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

DEFAULT_RENDERER_TYPE

public static final java.lang.String DEFAULT_RENDERER_TYPE
See Also:
Constant Field Values
Constructor Detail

HtmlDataTable

public HtmlDataTable()
Method Detail

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class javax.faces.component.UIData

isSortable

public boolean isSortable()
Description copied from class: AbstractHtmlDataTable
Define if the table is sortable or not

Specified by:
isSortable in class AbstractHtmlDataTable

setSortable

public void setSortable(boolean sortable)

isEmbedded

public boolean isEmbedded()
Description copied from class: AbstractHtmlDataTable
Avoids rendering the html table tags, thus, giving you a table rendering just rows. You can use this together with the detailStamp faces of the parent datatable to render child-tables using the same layout as the parent. Notice: You have to ensure both tables do have the same number of columns. Using the colspan attribute of the column tag might help alot.

Specified by:
isEmbedded in class AbstractHtmlDataTable

setEmbedded

public void setEmbedded(boolean embedded)

isDetailStampExpandedDefault

public boolean isDetailStampExpandedDefault()
Description copied from class: AbstractHtmlDataTable
true|false - true if the detailStamp should be expanded by default. default: false

Specified by:
isDetailStampExpandedDefault in class AbstractHtmlDataTable

setDetailStampExpandedDefault

public void setDetailStampExpandedDefault(boolean detailStampExpandedDefault)

getDetailStampLocation

public java.lang.String getDetailStampLocation()
Description copied from class: AbstractHtmlDataTable
before|after - where to render the detailStamp, before the actual row or after it. default: after

Specified by:
getDetailStampLocation in class AbstractHtmlDataTable

setDetailStampLocation

public void setDetailStampLocation(java.lang.String detailStampLocation)

getRowOnMouseOver

public java.lang.String getRowOnMouseOver()
Description copied from class: AbstractHtmlDataTable
Defines a JavaScript onmouseover event handler for each table row

Specified by:
getRowOnMouseOver in class AbstractHtmlDataTable

setRowOnMouseOver

public void setRowOnMouseOver(java.lang.String rowOnMouseOver)

getRowOnMouseOut

public java.lang.String getRowOnMouseOut()
Description copied from class: AbstractHtmlDataTable
Defines a JavaScript onmouseout event handler for each table row

Specified by:
getRowOnMouseOut in class AbstractHtmlDataTable

setRowOnMouseOut

public void setRowOnMouseOut(java.lang.String rowOnMouseOut)

getRowOnClick

public java.lang.String getRowOnClick()
Description copied from class: AbstractHtmlDataTable
Defines a JavaScript onclick event handler for each table row

Specified by:
getRowOnClick in class AbstractHtmlDataTable

setRowOnClick

public void setRowOnClick(java.lang.String rowOnClick)

getRowOnDblClick

public java.lang.String getRowOnDblClick()
Description copied from class: AbstractHtmlDataTable
Defines a JavaScript ondblclick event handler for each table row

Specified by:
getRowOnDblClick in class AbstractHtmlDataTable

setRowOnDblClick

public void setRowOnDblClick(java.lang.String rowOnDblClick)

getRowOnKeyDown

public java.lang.String getRowOnKeyDown()
Description copied from class: AbstractHtmlDataTable
Defines a JavaScript onkeydown event handler for each table row

Specified by:
getRowOnKeyDown in class AbstractHtmlDataTable

setRowOnKeyDown

public void setRowOnKeyDown(java.lang.String rowOnKeyDown)

getRowOnKeyPress

public java.lang.String getRowOnKeyPress()
Description copied from class: AbstractHtmlDataTable
Defines a JavaScript onkeypress event handler for each table row

Specified by:
getRowOnKeyPress in class AbstractHtmlDataTable

setRowOnKeyPress

public void setRowOnKeyPress(java.lang.String rowOnKeyPress)

getRowOnKeyUp

public java.lang.String getRowOnKeyUp()
Description copied from class: AbstractHtmlDataTable
Defines a JavaScript onkeyup event handler for each table row

Specified by:
getRowOnKeyUp in class AbstractHtmlDataTable

setRowOnKeyUp

public void setRowOnKeyUp(java.lang.String rowOnKeyUp)

getRowOnMouseDown

public java.lang.String getRowOnMouseDown()
Description copied from class: AbstractHtmlDataTable
Defines a JavaScript onmpusedown event handler for each table row

Specified by:
getRowOnMouseDown in class AbstractHtmlDataTable

setRowOnMouseDown

public void setRowOnMouseDown(java.lang.String rowOnMouseDown)

getRowOnMouseMove

public java.lang.String getRowOnMouseMove()
Description copied from class: AbstractHtmlDataTable
Defines a JavaScript onmousemove event handler for each table row

Specified by:
getRowOnMouseMove in class AbstractHtmlDataTable

setRowOnMouseMove

public void setRowOnMouseMove(java.lang.String rowOnMouseMove)

getRowOnMouseUp

public java.lang.String getRowOnMouseUp()
Description copied from class: AbstractHtmlDataTable
Defines a JavaScript onmouseup event handler for each table row

Specified by:
getRowOnMouseUp in class AbstractHtmlDataTable

setRowOnMouseUp

public void setRowOnMouseUp(java.lang.String rowOnMouseUp)

getRowGroupStyle

public java.lang.String getRowGroupStyle()
Description copied from class: AbstractHtmlDataTable
Corresponds to the HTML style attribute for grouped rows.

Specified by:
getRowGroupStyle in class AbstractHtmlDataTable

setRowGroupStyle

public void setRowGroupStyle(java.lang.String rowGroupStyle)

getRowGroupStyleClass

public java.lang.String getRowGroupStyleClass()
Description copied from class: AbstractHtmlDataTable
StyleClass for grouped rows.

Specified by:
getRowGroupStyleClass in class AbstractHtmlDataTable

setRowGroupStyleClass

public void setRowGroupStyleClass(java.lang.String rowGroupStyleClass)

getBodyStyle

public java.lang.String getBodyStyle()
Description copied from class: AbstractHtmlDataTable
Corresponds to the HTML style attribute for the table body tag

Specified by:
getBodyStyle in class AbstractHtmlDataTable

setBodyStyle

public void setBodyStyle(java.lang.String bodyStyle)

getBodyStyleClass

public java.lang.String getBodyStyleClass()
Description copied from class: AbstractHtmlDataTable
Corresponds to the HTML class attribute for the table body tag.

Specified by:
getBodyStyleClass in class AbstractHtmlDataTable

setBodyStyleClass

public void setBodyStyleClass(java.lang.String bodyStyleClass)

getNewspaperColumns

public int getNewspaperColumns()
Description copied from class: AbstractHtmlDataTable
The number of columns to wrap the table over. Default: 1 Set the number of columns the table will be divided over.

Specified by:
getNewspaperColumns in interface NewspaperTable
Specified by:
getNewspaperColumns in class AbstractHtmlDataTable

setNewspaperColumns

public void setNewspaperColumns(int newspaperColumns)

getNewspaperOrientation

public java.lang.String getNewspaperOrientation()
Description copied from class: AbstractHtmlDataTable
The orientation of the newspaper columns in the newspaper table - "horizontal" or "vertical". Default: vertical

Specified by:
getNewspaperOrientation in interface NewspaperTable
Specified by:
getNewspaperOrientation in class AbstractHtmlDataTable

setNewspaperOrientation

public void setNewspaperOrientation(java.lang.String newspaperOrientation)

isRenderedIfEmpty

public boolean isRenderedIfEmpty()
Description copied from class: AbstractHtmlDataTable
Indicates whether this table should be rendered if the underlying DataModel is empty. You could as well use rendered="#{not empty bean.list}", but this one causes the getList method of your model bean beeing called up to five times per request, which is not optimal when the list is backed by a DB table. Using renderedIfEmpty="false" solves this problem, because the MyFaces extended HtmlDataTable automatically caches the DataModel and calles the model getter only once per request. Default: true

Specified by:
isRenderedIfEmpty in class AbstractHtmlDataTable

setRenderedIfEmpty

public void setRenderedIfEmpty(boolean renderedIfEmpty)

getRowIndexVar

public java.lang.String getRowIndexVar()
Description copied from class: AbstractHtmlDataTable
A parameter name, under which the current rowIndex is set in request scope similar to the var parameter.

Specified by:
getRowIndexVar in class AbstractHtmlDataTable

setRowIndexVar

public void setRowIndexVar(java.lang.String rowIndexVar)

getRowCountVar

public java.lang.String getRowCountVar()
Description copied from class: AbstractHtmlDataTable
A parameter name, under which the rowCount is set in request scope similar to the var parameter.

Specified by:
getRowCountVar in class AbstractHtmlDataTable

setRowCountVar

public void setRowCountVar(java.lang.String rowCountVar)

getPreviousRowDataVar

public java.lang.String getPreviousRowDataVar()
Description copied from class: AbstractHtmlDataTable
A parameter name, under which the previous RowData Object is set in request scope similar to the rowIndexVar and rowCountVar parameters. Mind that the value of this request scope attribute is null in the first row or when isRowAvailable returns false for the previous row.

Specified by:
getPreviousRowDataVar in class AbstractHtmlDataTable

setPreviousRowDataVar

public void setPreviousRowDataVar(java.lang.String previousRowDataVar)

getSortedColumnVar

public java.lang.String getSortedColumnVar()
Description copied from class: AbstractHtmlDataTable
A parameter name, under which the a boolean is set in request scope similar to the var parameter. TRUE for the column that is currently sorted, FALSE otherwise.

Specified by:
getSortedColumnVar in class AbstractHtmlDataTable

setSortedColumnVar

public void setSortedColumnVar(java.lang.String sortedColumnVar)

getAlign

public java.lang.String getAlign()
Description copied from class: AbstractHtmlDataTable
HTML: Specifies the horizontal alignment of this element. Deprecated in HTML 4.01.

Specified by:
getAlign in class AbstractHtmlDataTable

setAlign

public void setAlign(java.lang.String align)

getRowId

public java.lang.String getRowId()
Description copied from class: AbstractHtmlDataTable
The id to use for

Specified by:
getRowId in class AbstractHtmlDataTable

setRowId

public void setRowId(java.lang.String rowId)

getDatafld

public java.lang.String getDatafld()
Description copied from class: AbstractHtmlDataTable
Reserved for future use.

Specified by:
getDatafld in class AbstractHtmlDataTable

setDatafld

public void setDatafld(java.lang.String datafld)

getDatasrc

public java.lang.String getDatasrc()
Description copied from class: AbstractHtmlDataTable
Reserved for future use.

Specified by:
getDatasrc in class AbstractHtmlDataTable

setDatasrc

public void setDatasrc(java.lang.String datasrc)

getDataformatas

public java.lang.String getDataformatas()
Description copied from class: AbstractHtmlDataTable
Reserved for future use.

Specified by:
getDataformatas in class AbstractHtmlDataTable

setDataformatas

public void setDataformatas(java.lang.String dataformatas)

getValueType

public java.lang.String getValueType()
Description copied from class: AbstractHtmlDataTable
Indicate the expected type of the EL expression pointed by value property. It is useful when vb.getType() cannot found the type, like when a map value is resolved on the expression.

Specified by:
getValueType in class AbstractHtmlDataTable

setValueType

public void setValueType(java.lang.String valueType)

getEnabledOnUserRole

public java.lang.String getEnabledOnUserRole()
Description copied from interface: UserRoleAware
If user is in given role, this component will be rendered normally. If not, no hyperlink is rendered but all nested tags (=body) are rendered.

Returns:

setEnabledOnUserRole

public void setEnabledOnUserRole(java.lang.String enabledOnUserRole)

getVisibleOnUserRole

public java.lang.String getVisibleOnUserRole()
Description copied from interface: UserRoleAware
If user is in given role, this component will be rendered normally. If not, nothing is rendered and the body of this tag will be skipped.

Returns:

setVisibleOnUserRole

public void setVisibleOnUserRole(java.lang.String visibleOnUserRole)

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class AbstractHtmlDataTable

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class AbstractHtmlDataTable


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.