org.apache.tapestry.contrib.table.components
Class Table

java.lang.Object
  |
  +--org.apache.tapestry.spec.BaseLocatable
        |
        +--org.apache.tapestry.AbstractComponent
              |
              +--org.apache.tapestry.BaseComponent
                    |
                    +--org.apache.tapestry.contrib.table.components.Table
All Implemented Interfaces:
IComponent, ILocatable, ILocationHolder, IRender, ITableModelSource

public class Table
extends BaseComponent
implements ITableModelSource

The facade component in the Table family. Table allows you to present a sortable and pagable table simply and easily by using only this one component. [Component Reference]

The Table component allows you to manipulate its appearance by allowing you to define the 'class' attributes of its internal elements. If you want to change the structure of the table, however, you can instead build your own using the lower level components TableView, TablePages, TableColumns, TableRows, and TableValues.

The Table component delegates the handling of the table model and related activities to the TableView, and more detailed information about the process can be found in the documentation of that class.

Parameter Type Direction Required Default Description
tableModel ITableModel in yes   The TableModel to be used to render the table. This binding is typically used only once at the beginning and then the component stores the model in the session state.

If you want the Table to read the model every time you can use a session state manager such as NullTableSessionStateManager that will force it to get the TableModel from this binding every time. If you do this, however, you will be responsible for saving the state of the table yourself.

You can also call the reset() method to force the Table to abandon its old model and reload a new one.

tableSessionStateManager ITableSessionStateManager in no FullTableSessionStateManager This is the session state manager that will control what part of the table model will be saved in the session state. It is then used to recreate the table model from using what was saved in the session. By default, the FullTableSessionStateManager is used, which just saves the entire model into the session. This behaviour may not be appropriate when the data is a lot or it is not Serializable.

You can use one of the stock implementations of ITableSessionStateManager to determine the session state behaviour, or you can just define your own.

tableSessionStoreManager ITableSessionStoreManager in no null Determines how the session state (returned by the session state manager) will be saved in the session. If this parameter is null, then the state will be saved as a persistent property. If it is not null, then the methods of the interface will be used to save and load the state.
row Object out no   The value object of the current row.
column ITableColumn out no   The object representing the current column.
pagesDisplayed int in no 7 Determines the maximum number of pages to be displayed in the page list when the table has more than one page.

For example, if the table has 20 pages, and 10 is the current page, pages from 7 to 13 in the page list will be shown if this parameter has a value of 7.

arrowUpAsset IAsset in no   The image to use to describe a column sorted in an ascending order.
arrowDownAsset IAsset in no   The image to use to describe a column sorted in a descending order.
pagesClass String in no   The CSS class of the table pages.
columnsClass String in no   The CSS class of the table columns.
rowsClass String in no   The CSS class of the table rows.
valuesClass String in no   The CSS class of the table values.

Version:
$Id: Table.java,v 1.1 2003/03/05 23:03:13 hlship Exp $
Author:
mindbridge

Fields inherited from interface org.apache.tapestry.contrib.table.model.ITableModelSource
TABLE_MODEL_SOURCE_ATTRIBUTE
 
Constructor Summary
Table()
           
 
Method Summary
 void fireObservedStateChange()
          Notifies the model source that the model state has changed, and that it should consider saving it.
 ITableModel getTableModel()
          Returns the table model currently used
 void reset()
          Resets the state of the component and forces it to load a new TableModel from the tableModel binding the next time it renders.
 
Methods inherited from class org.apache.tapestry.BaseComponent
addOuter, finishLoad, renderComponent
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, cleanupAfterRender, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, format, format, format, format, formatString, formatString, formatString, formatString, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification, toString
 
Methods inherited from class org.apache.tapestry.spec.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, renderBody, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.tapestry.ILocationHolder
setLocation
 
Methods inherited from interface org.apache.tapestry.ILocatable
getLocation
 

Constructor Detail

Table

public Table()
Method Detail

getTableModel

public ITableModel getTableModel()
Description copied from interface: ITableModelSource
Returns the table model currently used
Specified by:
getTableModel in interface ITableModelSource
See Also:
ITableModelSource.getTableModel()

fireObservedStateChange

public void fireObservedStateChange()
Description copied from interface: ITableModelSource
Notifies the model source that the model state has changed, and that it should consider saving it.

This method was added to allow using the table within a Block when the pageBeginRender() listener of the implementation will not be called and automatic state storage will therefore be hard to implement.

Specified by:
fireObservedStateChange in interface ITableModelSource
See Also:
ITableModelSource.fireObservedStateChange()

reset

public void reset()
Resets the state of the component and forces it to load a new TableModel from the tableModel binding the next time it renders.