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.HtmlDataTable
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder, NewspaperTable, UserRoleAware, ExtendedComponentBase

public class HtmlDataTable
extends HtmlDataTableHack
implements UserRoleAware, NewspaperTable

Version:
$Revision: 483569 $ $Date: 2006-12-07 18:49:35 +0100 (Do, 07 Dez 2006) $
Author:
Thomas Spiegl (latest modification by $Author: mmarinschek $), Manfred Geiler

Field Summary
static java.lang.String COMPONENT_TYPE
           
static java.lang.String DEFAULT_RENDERER_TYPE
           
static java.lang.String NEWSPAPER_COLUMNS_PROPERTY
          the property names
static java.lang.String NEWSPAPER_ORIENTATION_PROPERTY
           
static java.lang.String SPACER_FACET_NAME
           
 
Fields inherited from class javax.faces.component.UIData
COMPONENT_FAMILY
 
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
 void collapseAllDetails()
          Collapse all details
protected  int columnNameToIndex(java.lang.String columnName)
           
protected  javax.faces.model.DataModel createDataModel()
          Creates a new DataModel around the current value.
protected  HtmlCommandSortHeader createSortHeaderComponent(javax.faces.context.FacesContext context, javax.faces.component.UIColumn parentColumn, javax.faces.component.UIComponent initialHeaderFacet, java.lang.String propertyName)
           
 void encodeBegin(javax.faces.context.FacesContext context)
           
 void encodeEnd(javax.faces.context.FacesContext context)
           
 void expandAllDetails()
          Expand all details
 javax.faces.component.UIComponent findComponent(java.lang.String expr)
           
 java.lang.String getBodyStyle()
           
 java.lang.String getBodyStyleClass()
           
 java.lang.String getClientId(javax.faces.context.FacesContext context)
          Hack since RI does not call getRowIndex()
protected  javax.faces.model.DataModel getDataModel()
           
 java.lang.String getEnabledOnUserRole()
           
 int getFirst()
           
 java.lang.String getForceIdIndexFormula()
           
 int getNewspaperColumns()
          Set the number of columns the table will be divided over.
 java.lang.String getNewspaperOrientation()
           
protected  org.apache.myfaces.component.html.ext._SerializableDataModel getPreservedDataModel()
           
 java.lang.String getPreviousRowDataVar()
           
 java.lang.String getRowCountVar()
           
 java.lang.String getRowGroupStyle()
           
 java.lang.String getRowGroupStyleClass()
           
 java.lang.String getRowIndexVar()
           
 java.lang.String getRowOnClick()
           
 java.lang.String getRowOnDblClick()
           
 java.lang.String getRowOnKeyDown()
           
 java.lang.String getRowOnKeyPress()
           
 java.lang.String getRowOnKeyUp()
           
 java.lang.String getRowOnMouseDown()
           
 java.lang.String getRowOnMouseMove()
           
 java.lang.String getRowOnMouseOut()
           
 java.lang.String getRowOnMouseOver()
           
 java.lang.String getRowOnMouseUp()
           
 int getRows()
           
 java.lang.String getRowStyle()
           
 java.lang.String getRowStyleClass()
           
 org.apache.myfaces.component.html.ext._SerializableDataModel getSerializableDataModel()
           
 java.lang.String getSortColumn()
           
 int getSortColumnIndex()
           
 java.lang.String getSortedColumnVar()
           
 java.lang.String getSortProperty()
           
protected  java.lang.String getSortPropertyFromEL(javax.faces.component.UIComponent component)
           
 javax.faces.component.UIComponent getSpacer()
          Gets the spacer facet, between each pair of newspaper columns.
 TableContext getTableContext()
           
 java.lang.String getVarDetailToggler()
           
 java.lang.String getVisibleOnUserRole()
           
 boolean isCurrentDetailExpanded()
           
 boolean isDetailExpanded()
          Return true if the current detail row is expanded.
 boolean isExpandedEmpty()
           
 boolean isPreserveDataModel()
           
 boolean isPreserveSort()
           
 boolean isRendered()
           
 boolean isRenderedIfEmpty()
           
 boolean isSortable()
           
 boolean isSortAscending()
           
protected  boolean isSortHeaderNeeded(javax.faces.component.UIColumn parentColumn, javax.faces.component.UIComponent headerFacet)
           
protected  boolean isValidChildren()
           
 void processDecodes(javax.faces.context.FacesContext context)
           
 void processUpdates(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setBodyStyle(java.lang.String bodyStyle)
           
 void setBodyStyleClass(java.lang.String bodyStyleClass)
           
 void setEnabledOnUserRole(java.lang.String enabledOnUserRole)
           
 void setExpandedEmpty(boolean expandedEmpty)
          Clears expanded nodes set if expandedEmpty is true
 void setFirst(int first)
           
 void setForceIdIndexFormula(java.lang.String forceIdIndexFormula)
           
protected  void setIsValidChildren(boolean isValidChildren)
           
 void setNewspaperColumns(int newspaperColumns)
           
 void setNewspaperOrientation(java.lang.String newspaperOrientation)
          Set the orientation of the newspaper columns.
 void setPreserveDataModel(boolean preserveDataModel)
           
protected  void setPreservedDataModel(org.apache.myfaces.component.html.ext._SerializableDataModel preservedDataModel)
           
 void setPreserveSort(boolean preserveSort)
           
 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 setRowIndex(int rowIndex)
           
 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 setRows(int rows)
           
 void setRowStyle(java.lang.String rowStyle)
           
 void setRowStyleClass(java.lang.String rowStyleClass)
           
 void setSortable(boolean sortable)
           
 void setSortAscending(boolean sortAscending)
           
 void setSortColumn(java.lang.String sortColumn)
          Specify what column the data should be sorted on.
 void setSortColumnIndex(int sortColumnIndex)
           
 void setSortedColumnVar(java.lang.String sortedColumnVar)
           
 void setSortProperty(java.lang.String sortProperty)
           
 void setSpacer(javax.faces.component.UIComponent spacer)
           
 void setVarDetailToggler(java.lang.String varDetailToggler)
           
 void setVisibleOnUserRole(java.lang.String visibleOnUserRole)
           
 void toggleDetail()
          Change the status of the current detail row from collapsed to expanded or viceversa.
 
Methods inherited from class org.apache.myfaces.component.html.ext.HtmlDataTableHack
getRowCount, getRowData, getRowIndex, hasErrorMessages, isForceId, isPreserveRowStates, isRowAvailable, restoreDescendantComponentStates, saveDescendantComponentStates, setDataModel, setForceId, setPreserveRowStates, 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, getFamily, 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

NEWSPAPER_COLUMNS_PROPERTY

public static final java.lang.String NEWSPAPER_COLUMNS_PROPERTY
the property names

See Also:
Constant Field Values

SPACER_FACET_NAME

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

NEWSPAPER_ORIENTATION_PROPERTY

public static final java.lang.String NEWSPAPER_ORIENTATION_PROPERTY
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

getTableContext

public TableContext getTableContext()

getClientId

public java.lang.String getClientId(javax.faces.context.FacesContext context)
Description copied from class: HtmlDataTableHack
Hack since RI does not call getRowIndex()

Overrides:
getClientId in class HtmlDataTableHack

findComponent

public javax.faces.component.UIComponent findComponent(java.lang.String expr)
Overrides:
findComponent in class javax.faces.component.UIComponentBase

setRowIndex

public void setRowIndex(int rowIndex)
Overrides:
setRowIndex in class HtmlDataTableHack

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Overrides:
processDecodes in class javax.faces.component.UIData

processValidators

public void processValidators(javax.faces.context.FacesContext context)
Overrides:
processValidators in class HtmlDataTableHack
See Also:
UIData.processValidators(javax.faces.context.FacesContext)

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)
Overrides:
processUpdates in class HtmlDataTableHack
See Also:
UIData.processUpdates(javax.faces.context.FacesContext)

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
Overrides:
encodeBegin in class HtmlDataTableHack
Throws:
java.io.IOException
See Also:
UIData.encodeBegin(javax.faces.context.FacesContext)

isSortHeaderNeeded

protected boolean isSortHeaderNeeded(javax.faces.component.UIColumn parentColumn,
                                     javax.faces.component.UIComponent headerFacet)

createSortHeaderComponent

protected HtmlCommandSortHeader createSortHeaderComponent(javax.faces.context.FacesContext context,
                                                          javax.faces.component.UIColumn parentColumn,
                                                          javax.faces.component.UIComponent initialHeaderFacet,
                                                          java.lang.String propertyName)

getSortPropertyFromEL

protected java.lang.String getSortPropertyFromEL(javax.faces.component.UIComponent component)

columnNameToIndex

protected int columnNameToIndex(java.lang.String columnName)
Returns:
the index coresponding to the given column name.

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context)
               throws java.io.IOException
Overrides:
encodeEnd in class HtmlDataTableHack
Throws:
java.io.IOException
See Also:
UIData.encodeEnd(javax.faces.context.FacesContext)

getFirst

public int getFirst()
Overrides:
getFirst in class javax.faces.component.UIData

setFirst

public void setFirst(int first)
Overrides:
setFirst in class javax.faces.component.UIData

getRows

public int getRows()
Overrides:
getRows in class javax.faces.component.UIData

setRows

public void setRows(int rows)
Overrides:
setRows in class javax.faces.component.UIData

saveState

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

getDataModel

protected javax.faces.model.DataModel getDataModel()
Overrides:
getDataModel in class HtmlDataTableHack
See Also:
HtmlDataTableHack.getDataModel()

createDataModel

protected javax.faces.model.DataModel createDataModel()
Description copied from class: HtmlDataTableHack
Creates a new DataModel around the current value.

Overrides:
createDataModel in class HtmlDataTableHack
See Also:
HtmlDataTableHack.createDataModel()

restoreState

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

getSerializableDataModel

public org.apache.myfaces.component.html.ext._SerializableDataModel getSerializableDataModel()

isRendered

public boolean isRendered()
Overrides:
isRendered in class javax.faces.component.UIComponentBase

setForceIdIndexFormula

public void setForceIdIndexFormula(java.lang.String forceIdIndexFormula)

getForceIdIndexFormula

public java.lang.String getForceIdIndexFormula()

setSortColumn

public void setSortColumn(java.lang.String sortColumn)
Specify what column the data should be sorted on.

Note that calling this method immediately stores the value via any value-binding with name "sortColumn". This is done because this method is called by the HtmlCommandSortHeader component when the user has clicked on a column's sort header. In this case, the the model getter method mapped for name "value" needs to read this value in able to return the data in the desired order - but the HtmlCommandSortHeader component is usually "immediate" in order to avoid validating the enclosing form. Yes, this is rather hacky - but it works.


getSortColumn

public java.lang.String getSortColumn()

setSortAscending

public void setSortAscending(boolean sortAscending)

isSortAscending

public boolean isSortAscending()

setSortProperty

public void setSortProperty(java.lang.String sortProperty)

getSortProperty

public java.lang.String getSortProperty()

setSortable

public void setSortable(boolean sortable)

isSortable

public boolean isSortable()

setRowOnMouseOver

public void setRowOnMouseOver(java.lang.String rowOnMouseOver)

getRowOnMouseOver

public java.lang.String getRowOnMouseOver()

setRowOnMouseOut

public void setRowOnMouseOut(java.lang.String rowOnMouseOut)

getRowOnMouseOut

public java.lang.String getRowOnMouseOut()

setRowOnClick

public void setRowOnClick(java.lang.String rowOnClick)

getRowOnClick

public java.lang.String getRowOnClick()

setRowOnDblClick

public void setRowOnDblClick(java.lang.String rowOnDblClick)

getRowOnDblClick

public java.lang.String getRowOnDblClick()

getRowOnKeyDown

public java.lang.String getRowOnKeyDown()

setRowOnKeyDown

public void setRowOnKeyDown(java.lang.String rowOnKeyDown)

getRowOnKeyPress

public java.lang.String getRowOnKeyPress()

setRowOnKeyPress

public void setRowOnKeyPress(java.lang.String rowOnKeyPress)

getRowOnKeyUp

public java.lang.String getRowOnKeyUp()

setRowOnKeyUp

public void setRowOnKeyUp(java.lang.String rowOnKeyUp)

getRowStyleClass

public java.lang.String getRowStyleClass()

setRowStyleClass

public void setRowStyleClass(java.lang.String rowStyleClass)

getRowStyle

public java.lang.String getRowStyle()

setRowStyle

public void setRowStyle(java.lang.String rowStyle)

getRowOnMouseDown

public java.lang.String getRowOnMouseDown()

setRowOnMouseDown

public void setRowOnMouseDown(java.lang.String rowOnMouseDown)

getRowOnMouseMove

public java.lang.String getRowOnMouseMove()

setRowOnMouseMove

public void setRowOnMouseMove(java.lang.String rowOnMouseMove)

getRowOnMouseUp

public java.lang.String getRowOnMouseUp()

setRowOnMouseUp

public void setRowOnMouseUp(java.lang.String rowOnMouseUp)

isValidChildren

protected boolean isValidChildren()

setIsValidChildren

protected void setIsValidChildren(boolean isValidChildren)

getPreservedDataModel

protected org.apache.myfaces.component.html.ext._SerializableDataModel getPreservedDataModel()

setPreservedDataModel

protected void setPreservedDataModel(org.apache.myfaces.component.html.ext._SerializableDataModel preservedDataModel)

isCurrentDetailExpanded

public boolean isCurrentDetailExpanded()

setVarDetailToggler

public void setVarDetailToggler(java.lang.String varDetailToggler)

getVarDetailToggler

public java.lang.String getVarDetailToggler()

getRowGroupStyle

public java.lang.String getRowGroupStyle()

setRowGroupStyle

public void setRowGroupStyle(java.lang.String rowGroupStyle)

getRowGroupStyleClass

public java.lang.String getRowGroupStyleClass()

setRowGroupStyleClass

public void setRowGroupStyleClass(java.lang.String rowGroupStyleClass)

getBodyStyle

public java.lang.String getBodyStyle()

setBodyStyle

public void setBodyStyle(java.lang.String bodyStyle)

getBodyStyleClass

public java.lang.String getBodyStyleClass()

setBodyStyleClass

public void setBodyStyleClass(java.lang.String bodyStyleClass)

toggleDetail

public void toggleDetail()
Change the status of the current detail row from collapsed to expanded or viceversa.


isDetailExpanded

public boolean isDetailExpanded()
Return true if the current detail row is expanded.

Returns:
true if the current detail row is expanded.

getSortColumnIndex

public int getSortColumnIndex()

setSortColumnIndex

public void setSortColumnIndex(int sortColumnIndex)

getNewspaperColumns

public int getNewspaperColumns()
Set the number of columns the table will be divided over.

Specified by:
getNewspaperColumns in interface NewspaperTable

setNewspaperColumns

public void setNewspaperColumns(int newspaperColumns)

setNewspaperOrientation

public void setNewspaperOrientation(java.lang.String newspaperOrientation)
Set the orientation of the newspaper columns.


getNewspaperOrientation

public java.lang.String getNewspaperOrientation()
Specified by:
getNewspaperOrientation in interface NewspaperTable

getSpacer

public javax.faces.component.UIComponent getSpacer()
Gets the spacer facet, between each pair of newspaper columns.

Specified by:
getSpacer in interface NewspaperTable

setSpacer

public void setSpacer(javax.faces.component.UIComponent spacer)

expandAllDetails

public void expandAllDetails()
Expand all details


collapseAllDetails

public void collapseAllDetails()
Collapse all details


isExpandedEmpty

public boolean isExpandedEmpty()
Returns:
true is any of the details is expanded

setExpandedEmpty

public void setExpandedEmpty(boolean expandedEmpty)
Clears expanded nodes set if expandedEmpty is true

Parameters:
expandedEmpty -

setPreserveDataModel

public void setPreserveDataModel(boolean preserveDataModel)

isPreserveDataModel

public boolean isPreserveDataModel()

setPreserveSort

public void setPreserveSort(boolean preserveSort)

isPreserveSort

public boolean isPreserveSort()

setEnabledOnUserRole

public void setEnabledOnUserRole(java.lang.String enabledOnUserRole)
Specified by:
setEnabledOnUserRole in interface UserRoleAware

getEnabledOnUserRole

public java.lang.String getEnabledOnUserRole()
Specified by:
getEnabledOnUserRole in interface UserRoleAware

setVisibleOnUserRole

public void setVisibleOnUserRole(java.lang.String visibleOnUserRole)
Specified by:
setVisibleOnUserRole in interface UserRoleAware

getVisibleOnUserRole

public java.lang.String getVisibleOnUserRole()
Specified by:
getVisibleOnUserRole in interface UserRoleAware

setRenderedIfEmpty

public void setRenderedIfEmpty(boolean renderedIfEmpty)

isRenderedIfEmpty

public boolean isRenderedIfEmpty()

setRowIndexVar

public void setRowIndexVar(java.lang.String rowIndexVar)

getRowIndexVar

public java.lang.String getRowIndexVar()

setRowCountVar

public void setRowCountVar(java.lang.String rowCountVar)

getRowCountVar

public java.lang.String getRowCountVar()

setPreviousRowDataVar

public void setPreviousRowDataVar(java.lang.String previousRowDataVar)

getPreviousRowDataVar

public java.lang.String getPreviousRowDataVar()

setSortedColumnVar

public void setSortedColumnVar(java.lang.String sortedColumnVar)

getSortedColumnVar

public java.lang.String getSortedColumnVar()


Copyright © 2010. All Rights Reserved.