contrib:TableValues Component Index Component Index

contrib:TableView
org.apache.tapestry.contrib.table.components.TableView
Non Visual Component
 
Description
A low level Table component that wraps all other low level Table components. This component carries the ITableModel that is used by the other Table components. Please see the documentation of ITableModel if you need to know more about how a table is represented.

This component also handles the saving of the state of the model using an ITableSessionStateManager to determine what part of the model is to be saved and an ITableSessionStoreManager to determine how to save it.

Upon the beginning of a new request cycle when the table model is first needed, the model is obtained using the following process:

  • The persistent state of the table is loaded. If the tableSessionStoreManager binding has not been bound, the state is loaded from a persistent property within the component (it is null at the beginning). Otherwise the supplied ITableSessionStoreManager is used to load the persistent state.
  • The table model is recreated using the ITableSessionStateManager that could be supplied using the tableSessionStateManager binding (but has a default value and is therefore not required).
  • If the ITableSessionStateManager returns null, then a table model is taken from the tableModel binding. Thus, if the NullTableSessionStateManager is used, the table model would be taken from the tableModel binding every time.
Just before the rendering phase the persistent state of the model is saved in the session. This process occurs in reverse:
  • The persistent state of the model is taken via the ITableSessionStateManager.
  • If the tableSessionStoreManager binding has not been bound, the persistent state is saved as a persistent page property. Otherwise the supplied ITableSessionStoreManager is used to save the persistent state. Use of the ITableSessionStoreManager is usually necessary when tables with the same model have to be used across multiple pages, and hence the state has to be saved in the Visit, rather than in a persistent component property.
See Also
Table, TableColumns, TablePages, TableRows, TableValues
Parameters
Name 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.
element String in no "table" The tag that will be used to wrap the inner components. If no binding is given, the tag that will be generated is 'table'. If you would like to place the bounds of the table elsewhere, you can make the element 'span' or another neutral tag and manually define the table.

Body: removed
Informal parameters: allowed
Reserved parameters: none

Examples

This example is under construction.


contrib:TableValues Component Index Component Index