org.apache.myfaces.trinidad.component
Class UIXTable

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by org.apache.myfaces.trinidad.component.UIXComponent
          extended by org.apache.myfaces.trinidad.component.UIXComponentBase
              extended by org.apache.myfaces.trinidad.component.UIXCollection
                  extended by org.apache.myfaces.trinidad.component.UIXIterator
                      extended by org.apache.myfaces.trinidad.component.UIXTable
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder, CollectionComponent, RowKeyIndex
Direct Known Subclasses:
CoreTable

public class UIXTable
extends UIXIterator
implements CollectionComponent

Events:

Type Phases Description
org.apache.myfaces.trinidad.event.RowDisclosureEvent Apply Request Values
Invoke Application
The expansion event is generated for a table when the detail facet of a row is expanded or collapsed. For tree or a treeTable, the expansion event is generated when tree nodes are expanded or collapsed.
org.apache.myfaces.trinidad.event.SelectionEvent Apply Request Values
Invoke Application
The selection event is delivered when the table selection changes.
org.apache.myfaces.trinidad.event.RangeChangeEvent Apply Request Values
Invoke Application
The range change event is delivered when the user navigates.
org.apache.myfaces.trinidad.event.SortEvent Apply Request Values
Invoke Application
The sort event is delivered when the table column sort criteria is changed.
org.apache.myfaces.trinidad.event.AttributeChangeEvent Invoke Application
Apply Request Values
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing.


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String DETAIL_STAMP_FACET
           
static PropertyKey DISCLOSED_ROW_KEYS_KEY
           
static PropertyKey IMMEDIATE_KEY
           
static PropertyKey RANGE_CHANGE_LISTENER_KEY
           
static PropertyKey ROW_DISCLOSURE_LISTENER_KEY
           
static PropertyKey SELECTED_ROW_KEYS_KEY
           
static PropertyKey SELECTION_LISTENER_KEY
           
static PropertyKey SHOW_ALL_KEY
           
static PropertyKey SORT_LISTENER_KEY
           
static FacesBean.Type TYPE
           
 
Fields inherited from class org.apache.myfaces.trinidad.component.UIXIterator
FIRST_KEY, ROWS_KEY, VALUE_KEY, VAR_STATUS_KEY
 
Fields inherited from class org.apache.myfaces.trinidad.component.UIXCollection
VAR_KEY
 
Fields inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase
BINDING_KEY, ID_KEY, RENDERED_KEY, RENDERER_TYPE_KEY, TRANSIENT_KEY
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
  UIXTable()
          Construct an instance of the UIXTable.
protected UIXTable(java.lang.String rendererType)
          Construct an instance of the UIXTable.
 
Method Summary
 void addRangeChangeListener(RangeChangeListener listener)
          Adds a rangeChange listener.
 void addRowDisclosureListener(RowDisclosureListener listener)
          Adds a rowDisclosure listener.
 void addSelectionListener(SelectionListener listener)
          Adds a selection listener.
 void addSortListener(SortListener listener)
          Adds a sort listener.
 void broadcast(javax.faces.event.FacesEvent event)
          Delivers an event to the appropriate listeners.
protected  CollectionModel createCollectionModel(CollectionModel current, java.lang.Object value)
          Creates the CollectionModel to use with this component.
protected  FacesBean.Type getBeanType()
           
 javax.faces.component.UIComponent getDetailStamp()
          the component to stamp below every row which is disclosed.
 RowKeySet getDisclosedRowKeys()
          Gets the set of disclosed rows for this component.
 java.lang.String getFamily()
           
 javax.faces.el.MethodBinding getRangeChangeListener()
          Gets a method reference to a rangeChange listener that will be called when a new range is selected.
 RangeChangeListener[] getRangeChangeListeners()
          Returns an array of attached rangeChange listeners.
 javax.faces.el.MethodBinding getRowDisclosureListener()
          Gets a method reference to an ExpansionListener
 RowDisclosureListener[] getRowDisclosureListeners()
          Returns an array of attached rowDisclosure listeners.
 java.lang.Object getSelectedRowData()
          Gets the data for the first selected row.
 RowKeySet getSelectedRowKeys()
          Gets the selection state for this component.
 javax.faces.el.MethodBinding getSelectionListener()
          Gets a method reference to a selection listener
 SelectionListener[] getSelectionListeners()
          Returns an array of attached selection listeners.
 javax.faces.el.MethodBinding getSortListener()
          Gets a method reference to a sort listener
 SortListener[] getSortListeners()
          Returns an array of attached sort listeners.
protected  java.util.List<javax.faces.component.UIComponent> getStamps()
          Gets the stamps.
 boolean isImmediate()
          Gets whether or not data validation - client-side or server-side - should take place when events are generated by this component.
 boolean isShowAll()
          Gets whether the "Show All" option is selected.
protected  void processFacetsAndChildren(javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId)
          Process this component's facets and children.
 void queueEvent(javax.faces.event.FacesEvent event)
          Sets the phaseID of UI events depending on the "immediate" property.
 void removeRangeChangeListener(RangeChangeListener listener)
          Removes a rangeChange listener.
 void removeRowDisclosureListener(RowDisclosureListener listener)
          Removes a rowDisclosure listener.
 void removeSelectionListener(SelectionListener listener)
          Removes a selection listener.
 void removeSortListener(SortListener listener)
          Removes a sort listener.
protected  void restoreStampState(javax.faces.context.FacesContext context, javax.faces.component.UIComponent stamp, java.lang.Object stampState)
          Restores the state for the given stamp.
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
protected  java.lang.Object saveStampState(javax.faces.context.FacesContext context, javax.faces.component.UIComponent stamp)
          Saves the state for the given stamp.
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setDetailStamp(javax.faces.component.UIComponent detailStampFacet)
          the component to stamp below every row which is disclosed.
 void setDisclosedRowKeys(RowKeySet disclosedRowKeys)
          Sets the set of disclosed rows for this component.
 void setImmediate(boolean immediate)
          Sets whether or not data validation - client-side or server-side - should take place when events are generated by this component.
 void setRangeChangeListener(javax.faces.el.MethodBinding rangeChangeListener)
          Sets a method reference to a rangeChange listener that will be called when a new range is selected.
 void setRowDisclosureListener(javax.faces.el.MethodBinding rowDisclosureListener)
          Sets a method reference to an ExpansionListener
 void setSelectedRowKeys(RowKeySet selectedRowKeys)
          Sets the selection state for this component.
 void setSelectionListener(javax.faces.el.MethodBinding selectionListener)
          Sets a method reference to a selection listener
 void setShowAll(boolean showAll)
          Sets whether the "Show All" option is selected.
 void setSortCriteria(java.util.List<SortCriterion> criteria)
          Sorts this collection by the given criteria.
 void setSortListener(javax.faces.el.MethodBinding sortListener)
          Sets a method reference to a sort listener
 
Methods inherited from class org.apache.myfaces.trinidad.component.UIXIterator
createVarStatusMap, encodeChildren, getFirst, getRendersChildren, getRows, getValue, getVarStatus, setFirst, setRows, setValue, setVarStatus
 
Methods inherited from class org.apache.myfaces.trinidad.component.UIXCollection
clearCurrencyStringCache, decodeChildrenImpl, encodeBegin, encodeEnd, getClientRowKey, getClientRowKeyManager, getCollectionModel, getCollectionModel, getCurrencyString, getLocalClientId, getRowCount, getRowData, getRowData, getRowIndex, getRowKey, getSortCriteria, getVar, isRowAvailable, isRowAvailable, isSortable, postRowDataChange, preRowDataChange, processComponent, processDecodes, processSaveState, resetStampState, setClientRowKey, setCurrencyString, setRowIndex, setRowKey, setVar, updateChildrenImpl, validateChildrenImpl
 
Methods inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase
addAttributeChange, addAttributeChangeListener, addFacesListener, broadcastToMethodBinding, createFacesBean, decode, decodeChildren, encodeAll, findComponent, getAttributeChangeListener, getAttributeChangeListeners, getAttributes, getBooleanProperty, getChildCount, getChildren, getClientId, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacetNames, getFacets, getFacetsAndChildren, getId, getIntProperty, getLifecycleRenderer, getParent, getProperty, getPropertyKey, getRenderer, getRendererType, getValueBinding, isRendered, isTransient, markInitialState, processRestoreState, processUpdates, processValidators, removeAttributeChangeListener, removeFacesListener, setAttributeChangeListener, setBooleanProperty, setId, setIntProperty, setParent, setProperty, setRendered, setRendererType, setTransient, setValueBinding, toString, updateChildren, validateChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.myfaces.trinidad.component.CollectionComponent
getFirst, getRows, getVar
 
Methods inherited from interface org.apache.myfaces.trinidad.model.RowKeyIndex
getRowCount, getRowData, getRowData, getRowIndex, getRowKey, isRowAvailable, isRowAvailable, setRowIndex, setRowKey
 

Field Detail

TYPE

public static final FacesBean.Type TYPE

ROW_DISCLOSURE_LISTENER_KEY

public static final PropertyKey ROW_DISCLOSURE_LISTENER_KEY

DISCLOSED_ROW_KEYS_KEY

public static final PropertyKey DISCLOSED_ROW_KEYS_KEY

SELECTION_LISTENER_KEY

public static final PropertyKey SELECTION_LISTENER_KEY

SELECTED_ROW_KEYS_KEY

public static final PropertyKey SELECTED_ROW_KEYS_KEY

IMMEDIATE_KEY

public static final PropertyKey IMMEDIATE_KEY

SORT_LISTENER_KEY

public static final PropertyKey SORT_LISTENER_KEY

RANGE_CHANGE_LISTENER_KEY

public static final PropertyKey RANGE_CHANGE_LISTENER_KEY

SHOW_ALL_KEY

public static final PropertyKey SHOW_ALL_KEY

DETAIL_STAMP_FACET

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

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
Constructor Detail

UIXTable

public UIXTable()
Construct an instance of the UIXTable.


UIXTable

protected UIXTable(java.lang.String rendererType)
Construct an instance of the UIXTable.

Method Detail

setSortCriteria

public void setSortCriteria(java.util.List<SortCriterion> criteria)
Description copied from class: UIXCollection
Sorts this collection by the given criteria.

Overrides:
setSortCriteria in class UIXCollection
Parameters:
criteria - Each element in this List must be of type SortCriterion.
See Also:
SortCriterion, CollectionModel.setSortCriteria(java.util.List)

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Sets the phaseID of UI events depending on the "immediate" property.

Overrides:
queueEvent in class UIXCollection
Parameters:
event - a FacesEvent

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Delivers an event to the appropriate listeners.

Overrides:
broadcast in class UIXCollection
Parameters:
event -
Throws:
javax.faces.event.AbortProcessingException

saveState

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

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 UIXCollection

getSelectedRowData

public java.lang.Object getSelectedRowData()
Gets the data for the first selected row. This is useful when using EL to get at column data for the selected row when using a table with single selection.

Returns:
null if there is nothing selected in the table.

processFacetsAndChildren

protected final void processFacetsAndChildren(javax.faces.context.FacesContext context,
                                              javax.faces.event.PhaseId phaseId)
Description copied from class: UIXCollection
Process this component's facets and children. This method should call UIXCollection.processComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent, javax.faces.event.PhaseId) as many times as necessary for each facet and child. UIXCollection.processComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent, javax.faces.event.PhaseId) may be called repeatedly for the same child if that child is being stamped.

Overrides:
processFacetsAndChildren in class UIXIterator

getStamps

protected final java.util.List<javax.faces.component.UIComponent> getStamps()
Gets the stamps. This returns the children of this component plus the detail stamp (if any).

Overrides:
getStamps in class UIXCollection
Returns:
each element must be of type UIComponent.

saveStampState

protected final java.lang.Object saveStampState(javax.faces.context.FacesContext context,
                                                javax.faces.component.UIComponent stamp)
Saves the state for the given stamp. This method avoids changing the state of facets on columns.

Overrides:
saveStampState in class UIXCollection
Returns:
this object must be Serializable if client-side state saving is used.

restoreStampState

protected final void restoreStampState(javax.faces.context.FacesContext context,
                                       javax.faces.component.UIComponent stamp,
                                       java.lang.Object stampState)
Restores the state for the given stamp. This method avoids changing the state of facets on columns.

Overrides:
restoreStampState in class UIXCollection

createCollectionModel

protected final CollectionModel createCollectionModel(CollectionModel current,
                                                      java.lang.Object value)
Description copied from class: UIXCollection
Creates the CollectionModel to use with this component.

Overrides:
createCollectionModel in class UIXIterator
Parameters:
current - the current CollectionModel, or null if there is none.
value - this is the value returned from UIXCollection.getValue()

getDetailStamp

public final javax.faces.component.UIComponent getDetailStamp()
the component to stamp below every row which is disclosed. Adding a detail facet will automatically cause the detail column to be displayed.


setDetailStamp

public final void setDetailStamp(javax.faces.component.UIComponent detailStampFacet)
the component to stamp below every row which is disclosed. Adding a detail facet will automatically cause the detail column to be displayed.


getRowDisclosureListener

public final javax.faces.el.MethodBinding getRowDisclosureListener()
Gets a method reference to an ExpansionListener

Returns:
the new rowDisclosureListener value

setRowDisclosureListener

public final void setRowDisclosureListener(javax.faces.el.MethodBinding rowDisclosureListener)
Sets a method reference to an ExpansionListener

Parameters:
rowDisclosureListener - the new rowDisclosureListener value

getDisclosedRowKeys

public final RowKeySet getDisclosedRowKeys()
Gets the set of disclosed rows for this component. Each entry in the set is a rowKey.

Returns:
the new disclosedRowKeys value

setDisclosedRowKeys

public final void setDisclosedRowKeys(RowKeySet disclosedRowKeys)
Sets the set of disclosed rows for this component. Each entry in the set is a rowKey.

Parameters:
disclosedRowKeys - the new disclosedRowKeys value

getSelectionListener

public final javax.faces.el.MethodBinding getSelectionListener()
Gets a method reference to a selection listener

Returns:
the new selectionListener value

setSelectionListener

public final void setSelectionListener(javax.faces.el.MethodBinding selectionListener)
Sets a method reference to a selection listener

Parameters:
selectionListener - the new selectionListener value

getSelectedRowKeys

public final RowKeySet getSelectedRowKeys()
Gets the selection state for this component.

Returns:
the new selectedRowKeys value

setSelectedRowKeys

public final void setSelectedRowKeys(RowKeySet selectedRowKeys)
Sets the selection state for this component.

Parameters:
selectedRowKeys - the new selectedRowKeys value

isImmediate

public final boolean isImmediate()
Gets whether or not data validation - client-side or server-side - should take place when events are generated by this component. When immediate is true, the default ActionListener provided by the JavaServer Faces implementation should be executed during Apply Request Values phase of the request processing lifecycle, rather than waiting until the Invoke Application phase.

Returns:
the new immediate value

setImmediate

public final void setImmediate(boolean immediate)
Sets whether or not data validation - client-side or server-side - should take place when events are generated by this component. When immediate is true, the default ActionListener provided by the JavaServer Faces implementation should be executed during Apply Request Values phase of the request processing lifecycle, rather than waiting until the Invoke Application phase.

Parameters:
immediate - the new immediate value

getSortListener

public final javax.faces.el.MethodBinding getSortListener()
Gets a method reference to a sort listener

Returns:
the new sortListener value

setSortListener

public final void setSortListener(javax.faces.el.MethodBinding sortListener)
Sets a method reference to a sort listener

Parameters:
sortListener - the new sortListener value

getRangeChangeListener

public final javax.faces.el.MethodBinding getRangeChangeListener()
Gets a method reference to a rangeChange listener that will be called when a new range is selected.

Returns:
the new rangeChangeListener value

setRangeChangeListener

public final void setRangeChangeListener(javax.faces.el.MethodBinding rangeChangeListener)
Sets a method reference to a rangeChange listener that will be called when a new range is selected.

Parameters:
rangeChangeListener - the new rangeChangeListener value

isShowAll

public final boolean isShowAll()
Gets whether the "Show All" option is selected. The "Show All" option is available if there are less than 30 options and the row count in the data model is known.

Returns:
the new showAll value

setShowAll

public final void setShowAll(boolean showAll)
Sets whether the "Show All" option is selected. The "Show All" option is available if there are less than 30 options and the row count in the data model is known.

Parameters:
showAll - the new showAll value

addRowDisclosureListener

public final void addRowDisclosureListener(RowDisclosureListener listener)
Adds a rowDisclosure listener.

Parameters:
listener - the rowDisclosure listener to add

removeRowDisclosureListener

public final void removeRowDisclosureListener(RowDisclosureListener listener)
Removes a rowDisclosure listener.

Parameters:
listener - the rowDisclosure listener to remove

getRowDisclosureListeners

public final RowDisclosureListener[] getRowDisclosureListeners()
Returns an array of attached rowDisclosure listeners.

Returns:
an array of attached rowDisclosure listeners.

addSelectionListener

public final void addSelectionListener(SelectionListener listener)
Adds a selection listener.

Parameters:
listener - the selection listener to add

removeSelectionListener

public final void removeSelectionListener(SelectionListener listener)
Removes a selection listener.

Parameters:
listener - the selection listener to remove

getSelectionListeners

public final SelectionListener[] getSelectionListeners()
Returns an array of attached selection listeners.

Returns:
an array of attached selection listeners.

addRangeChangeListener

public final void addRangeChangeListener(RangeChangeListener listener)
Adds a rangeChange listener.

Parameters:
listener - the rangeChange listener to add

removeRangeChangeListener

public final void removeRangeChangeListener(RangeChangeListener listener)
Removes a rangeChange listener.

Parameters:
listener - the rangeChange listener to remove

getRangeChangeListeners

public final RangeChangeListener[] getRangeChangeListeners()
Returns an array of attached rangeChange listeners.

Returns:
an array of attached rangeChange listeners.

addSortListener

public final void addSortListener(SortListener listener)
Adds a sort listener.

Parameters:
listener - the sort listener to add

removeSortListener

public final void removeSortListener(SortListener listener)
Removes a sort listener.

Parameters:
listener - the sort listener to remove

getSortListeners

public final SortListener[] getSortListeners()
Returns an array of attached sort listeners.

Returns:
an array of attached sort listeners.

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class UIXIterator

getBeanType

protected FacesBean.Type getBeanType()
Overrides:
getBeanType in class UIXIterator


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.