|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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
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.
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
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
|
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. |
Fields inherited from interface org.apache.tapestry.contrib.table.model.ITableModelSource |
TABLE_MODEL_SOURCE_ATTRIBUTE |
Constructor Summary | |
TableView()
|
Method Summary | |
void |
fireObservedStateChange()
Notifies the model source that the model state has changed, and that it should consider saving it. |
String |
getElement()
Returns the element. |
IBinding |
getElementBinding()
Returns the elementBinding. |
Serializable |
getSessionState()
Returns the sessionState. |
ITableModel |
getTableModel()
Returns the tableModel. |
IBinding |
getTableModelBinding()
Returns the tableModelBinding. |
ITableSessionStateManager |
getTableSessionStateManager()
|
IBinding |
getTableSessionStateManagerBinding()
Returns the tableSessionStateManagerBinding. |
ITableSessionStoreManager |
getTableSessionStoreManager()
|
IBinding |
getTableSessionStoreManagerBinding()
Returns the tableSessionStoreManagerBinding. |
protected Serializable |
loadSessionState()
|
void |
pageBeginRender(PageEvent objEvent)
Invoked before just before the page renders a response. |
void |
pageDetached(PageEvent objEvent)
Invoked by the page from its IPage.detach() method. |
protected void |
renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
Renders the top level components contained by the receiver. |
void |
reset()
|
protected void |
saveSessionState()
|
void |
setElementBinding(IBinding elementBinding)
Sets the elementBinding. |
void |
setSessionState(Serializable sessionState)
Sets the sessionState. |
void |
setTableModelBinding(IBinding tableModelBinding)
Sets the tableModelBinding. |
void |
setTableSessionStateManagerBinding(IBinding tableSessionStateManagerBinding)
Sets the tableSessionStateManagerBinding. |
void |
setTableSessionStoreManagerBinding(IBinding tableSessionStoreManagerBinding)
Sets the tableSessionStoreManagerBinding. |
protected void |
storeSessionState(Serializable objState)
|
void |
updateSessionState(Serializable sessionState)
|
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.event.PageRenderListener |
pageEndRender |
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 void pageDetached(PageEvent objEvent)
PageDetachListener
IPage.detach()
method.pageDetached
in interface PageDetachListener
PageDetachListener.pageDetached(PageEvent)
public void reset()
public IBinding getTableModelBinding()
public void setTableModelBinding(IBinding tableModelBinding)
tableModelBinding
- The tableModelBinding to setpublic ITableModel getTableModel()
getTableModel
in interface ITableModelSource
public void fireObservedStateChange()
ITableModelSource
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.
fireObservedStateChange
in interface ITableModelSource
ITableModelSource.fireObservedStateChange()
public IBinding getTableSessionStateManagerBinding()
public void setTableSessionStateManagerBinding(IBinding tableSessionStateManagerBinding)
tableSessionStateManagerBinding
- The tableSessionStateManagerBinding to setpublic ITableSessionStateManager getTableSessionStateManager()
public IBinding getTableSessionStoreManagerBinding()
public void setTableSessionStoreManagerBinding(IBinding tableSessionStoreManagerBinding)
tableSessionStoreManagerBinding
- The tableSessionStoreManagerBinding to setpublic ITableSessionStoreManager getTableSessionStoreManager()
public Serializable getSessionState()
public void setSessionState(Serializable sessionState)
sessionState
- The sessionState to setpublic void updateSessionState(Serializable sessionState)
protected Serializable loadSessionState()
protected void saveSessionState()
protected void storeSessionState(Serializable objState)
public void pageBeginRender(PageEvent objEvent)
PageRenderListener
pageBeginRender
in interface PageRenderListener
PageRenderListener.pageBeginRender(PageEvent)
public IBinding getElementBinding()
public void setElementBinding(IBinding elementBinding)
elementBinding
- The elementBinding to setpublic String getElement()
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
BaseComponent
renderComponent
in class BaseComponent
BaseComponent.renderComponent(IMarkupWriter, IRequestCycle)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |