|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry.spec.BaseLocatable org.apache.tapestry.AbstractComponent org.apache.tapestry.BaseComponent org.apache.tapestry.contrib.table.components.TableView
public abstract class TableView
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:
ITableSessionStoreManager
is used
to load the persistent state.
ITableSessionStateManager
that
could be supplied using the tableSessionStateManager binding
(but has a default value and is therefore not required).
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.
ITableSessionStateManager
.
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.
Please see the Component Reference for details on how to use this component. [Component Reference]
Field Summary |
---|
Fields inherited from interface org.apache.tapestry.contrib.table.model.ITableModelSource |
---|
TABLE_MODEL_SOURCE_ATTRIBUTE |
Constructor Summary | |
---|---|
TableView()
The component constructor. |
Method Summary | |
---|---|
void |
fireObservedStateChange()
Invoked when there is a modification of the table state and it needs to be saved |
protected ITableColumnModel |
generateTableColumnModel(String strDesc)
Generate a table column model out of the description string provided. |
protected ITableModel |
generateTableModel(SimpleTableState objState)
Generate a table model using the 'source' and 'columns' parameters. |
ITableModel |
getCachedTableModelValue()
|
abstract Object |
getColumns()
|
abstract IBinding |
getColumnsBinding()
|
abstract IComponent |
getColumnSettingsContainer()
|
ITableSessionStateManager |
getDefaultTableSessionStateManager()
The default session state manager to be used in case no such manager is provided by the corresponding parameter. |
abstract String |
getInitialSortColumn()
|
abstract boolean |
getInitialSortOrder()
|
abstract IBinding |
getPageSizeBinding()
|
abstract Serializable |
getSessionState()
|
abstract Object |
getSource()
|
protected ITableColumnModel |
getTableColumnModel()
Returns the table column model as specified by the 'columns' binding. |
ITableModel |
getTableModel()
Returns the tableModel. |
abstract ITableModel |
getTableModelValue()
|
abstract ITableSessionStateManager |
getTableSessionStateManager()
|
abstract ITableSessionStoreManager |
getTableSessionStoreManager()
|
protected Serializable |
loadSessionState()
Loads the table state using the SessionStoreManager. |
void |
pageBeginRender(PageEvent event)
Ensures that the table state is saved before the render phase begins in case there are modifications for which fireObservedStateChange()
has not been invoked. |
void |
pageDetached(PageEvent objEvent)
Invokes the component member initializations. |
void |
pageEndRender(PageEvent objEvent)
Empty implementation of PageRenderListener.pageEndRender(PageEvent) . |
protected void |
renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
Stores a pointer to this component in the Request Cycle while rendering so that wrapped components have access to it. |
void |
reset()
Resets the table by removing any stored table state. |
protected void |
saveSessionState()
Saves the table state using the SessionStateManager to determine what to save and the SessionStoreManager to determine where to save it. |
abstract void |
setSessionState(Serializable sessionState)
|
protected void |
storeSessionState(Serializable objState)
Stores the table state using the SessionStoreManager. |
protected void |
validateValues()
Make sure that the values stored in the model are useable and correct. |
Methods inherited from class org.apache.tapestry.BaseComponent |
---|
addOuter, finishLoad |
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 |
---|
public TableView()
Method Detail |
---|
public abstract ITableModel getTableModelValue()
public abstract Object getSource()
public abstract Object getColumns()
public abstract IBinding getColumnsBinding()
public abstract IBinding getPageSizeBinding()
public abstract String getInitialSortColumn()
public abstract boolean getInitialSortOrder()
public abstract ITableSessionStateManager getTableSessionStateManager()
public abstract ITableSessionStoreManager getTableSessionStoreManager()
public abstract IComponent getColumnSettingsContainer()
public abstract Serializable getSessionState()
public abstract void setSessionState(Serializable sessionState)
public void pageDetached(PageEvent objEvent)
pageDetached
in interface PageDetachListener
PageDetachListener.pageDetached(PageEvent)
public void reset()
public ITableModel getCachedTableModelValue()
public ITableModel getTableModel()
getTableModel
in interface ITableModelSource
protected ITableModel generateTableModel(SimpleTableState objState)
protected ITableColumnModel getTableColumnModel()
protected ITableColumnModel generateTableColumnModel(String strDesc)
strDesc
- the description of the column model to be generated
public ITableSessionStateManager getDefaultTableSessionStateManager()
public void fireObservedStateChange()
fireObservedStateChange
in interface ITableModelSource
ITableModelSource.fireObservedStateChange()
public void pageBeginRender(PageEvent event)
fireObservedStateChange()
has not been invoked.
pageBeginRender
in interface PageRenderListener
PageRenderListener.pageBeginRender(org.apache.tapestry.event.PageEvent)
public void pageEndRender(PageEvent objEvent)
AbstractComponent
PageRenderListener.pageEndRender(PageEvent)
.
This allows classes to implement
PageRenderListener
and only
implement the
PageRenderListener.pageBeginRender(PageEvent)
method.
pageEndRender
in interface PageRenderListener
pageEndRender
in class AbstractComponent
PageRenderListener.pageEndRender(PageEvent)
protected void saveSessionState()
protected Serializable loadSessionState()
protected void storeSessionState(Serializable objState)
objState
- the table state to storeprotected void validateValues()
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
renderComponent
in class BaseComponent
BaseComponent.renderComponent(IMarkupWriter, IRequestCycle)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |