|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.Component org.apache.wicket.MarkupContainer org.apache.wicket.Page
public abstract class Page
Abstract base class for pages. As a MarkupContainer subclass, a Page can contain a component hierarchy and markup in some markup language such as HTML. Users of the framework should not attempt to subclass Page directly. Instead they should subclass a subclass of Page that is appropriate to the markup type they are using, such as WebPage (for HTML markup).
MarkupContainer
.
IModel
). A Page
can be assigned a model by passing one to the Page's constructor, by overriding initModel() or
with an explicit invocation of setModel(). If the model is a
CompoundPropertyModel
, Components on the Page can use the Page's
model implicitly via container inheritance. If a Component is not assigned a model, the
initModel() override in Component will cause that Component to use the nearest CompoundModel in
the parent chain, in this case, the Page's model. For basic CompoundModels, the name of the
Component determines which property of the implicit page model the component is bound to. If more
control is desired over the binding of Components to the page model (for example, if you want to
specify some property expression other than the component's name for retrieving the model
object), BoundCompoundPropertyModel can be used.
ISessionStore
's factory method
newVersionManager().
IAuthorizationStrategy
, SimplePageAuthorizationStrategy
WebPage
,
MarkupContainer
,
CompoundPropertyModel
,
BoundCompoundPropertyModel
,
Component
,
IPageVersionManager
,
UndoPageVersionManager
,
Serialized FormNested Class Summary | |
---|---|
static interface |
Page.IPageSerializer
You can set implementation of the interface in the serializer then that
implementation will handle the serialization of this page. |
Nested classes/interfaces inherited from class org.apache.wicket.Component |
---|
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor, Component.VisibilityChange |
Field Summary | |
---|---|
static int |
LATEST_VERSION
When passed to getVersion(int) the latest page version is returned. |
static java.lang.ThreadLocal |
serializer
This is a thread local that is used for serializing page references in this page.It stores a Page.IPageSerializer which can be set by the outside world to do the serialization of this
page. |
Fields inherited from class org.apache.wicket.Component |
---|
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
Fields inherited from interface org.apache.wicket.IRedirectListener |
---|
INTERFACE |
Constructor Summary | |
---|---|
protected |
Page()
Constructor. |
protected |
Page(IModel model)
Constructor. |
protected |
Page(IPageMap pageMap)
Constructor. |
protected |
Page(IPageMap pageMap,
IModel model)
Constructor. |
protected |
Page(IPageMap pageMap,
PageParameters parameters)
The PageParameters parameter will be stored in this page and then those parameters
will be used to create stateless links to this bookmarkable page. |
protected |
Page(PageParameters parameters)
The PageParameters parameter will be stored in this page and then those parameters
will be used to create stateless links to this bookmarkable page. |
Method Summary | |
---|---|
void |
afterCallComponent(Component component,
RequestListenerInterface listener)
Called right after a component's listener method (the provided method argument) was called. |
void |
beforeCallComponent(Component component,
RequestListenerInterface listener)
Called just before a component's listener method (the provided method argument) is called. |
protected void |
componentChanged(Component component,
MarkupContainer parent)
This method will be called for all components that are changed on the page So also auto components or components that are not versioned. |
void |
componentRendered(Component component)
Adds a component to the set of rendered components. |
protected void |
configureResponse()
Set-up response with appropriate content type, locale and encoding. |
void |
detachModels()
Detaches any attached models referenced by this page. |
void |
dirty()
Mark this page as dirty in the session |
void |
endComponentRender(Component component)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
expireOldestVersion()
Expire the oldest version of this page |
int |
getAjaxVersionNumber()
|
short |
getAutoIndex()
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
int |
getCurrentVersionNumber()
|
java.lang.String |
getId()
Gets the id of this component. |
java.lang.String |
getMarkupType()
Get the type of associated markup for this component. |
int |
getNumericId()
|
java.lang.Class |
getPageClass()
|
IPageMap |
getPageMap()
|
IPageMapEntry |
getPageMapEntry()
|
java.lang.String |
getPageMapName()
|
PageParameters |
getPageParameters()
The PageParameters object that was used to construct this page. |
PageReference |
getPageReference()
Gets page instance's unique identifier |
long |
getSizeInBytes()
|
boolean |
getStatelessHint()
Returns whether the page should try to be stateless. |
Page |
getVersion(int versionNumber)
Override this method to implement a custom way of producing a version of a Page when it cannot be found in the Session. |
int |
getVersions()
|
java.lang.String |
hierarchyAsString()
|
void |
ignoreVersionMerge()
Call this method when the current (ajax) request shouldn't merge the changes that are happening to the page with the previous version. |
protected void |
internalOnModelChanged()
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
boolean |
isBookmarkable()
Bookmarkable page can be instantiated using a bookmarkable URL. |
boolean |
isErrorPage()
Override this method and return true if your page is used to display Wicket errors. |
boolean |
isPageStateless()
Gets whether the page is stateless. |
protected void |
moveToPageMap(IPageMap map)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
protected IPageVersionManager |
newVersionManager()
Deprecated. TODO Remove in 1.4 |
protected void |
onBeforeRender()
Called just before a component is rendered. |
protected void |
onDetach()
Called to allow a component to detach resources after use. |
void |
onPageAttached()
Called when the page is retrieved from Session. |
void |
onRedirect()
Redirect to this page. |
protected void |
onRender(MarkupStream markupStream)
Renders this container to the given response object. |
void |
removePersistedFormData(java.lang.Class formClass,
boolean disablePersistence)
Convenience method. |
void |
renderPage()
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
Page |
rollbackPage(int numberOfVersions)
This returns a page instance that is rollbacked the number of versions that is specified compared to the current page. |
void |
setNumericId(int id)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
setStatelessHint(boolean value)
Sets whether the page should try to be stateless. |
void |
startComponentRender(Component component)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
java.lang.String |
toString()
Get the string representation of this container. |
protected java.lang.Object |
writeReplace()
|
Methods inherited from class org.apache.wicket.MarkupContainer |
---|
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, visitChildren, visitChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.wicket.session.pagemap.IPageMapEntry |
---|
getPage |
Field Detail |
---|
public static final int LATEST_VERSION
getVersion(int)
the latest page version is returned.
public static final java.lang.ThreadLocal serializer
Page.IPageSerializer
which can be set by the outside world to do the serialization of this
page.
Constructor Detail |
---|
protected Page()
protected Page(IModel model)
model
- See ComponentComponent.Component(String, IModel)
protected Page(IPageMap pageMap)
pageMap
- The page map to put this page inprotected Page(IPageMap pageMap, IModel model)
pageMap
- the page map to put this page inmodel
- See ComponentComponent.Component(String, IModel)
protected Page(PageParameters parameters)
PageParameters
parameter will be stored in this page and then those parameters
will be used to create stateless links to this bookmarkable page.
parameters
- externally passed parametersPageParameters
protected Page(IPageMap pageMap, PageParameters parameters)
PageParameters
parameter will be stored in this page and then those parameters
will be used to create stateless links to this bookmarkable page.
pageMap
- the page map to put this page inparameters
- externally passed parametersPageParameters
Method Detail |
---|
public PageParameters getPageParameters()
PageParameters
object that was used to construct this page. This will be used in
creating stateless/bookmarkable links to this page
PageParameters
The construction page parameterpublic void afterCallComponent(Component component, RequestListenerInterface listener)
beforeCallComponent(Component, RequestListenerInterface)
or the method invocation itself failed.
component
- the component that is to be calledlistener
- the listener of that component that is to be calledpublic void beforeCallComponent(Component component, RequestListenerInterface listener)
afterCallComponent(Component, RequestListenerInterface)
will always be
called.
component
- the component that is to be calledlistener
- the listener of that component that is to be calledpublic final void componentRendered(Component component)
component
- The component that was renderedpublic void detachModels()
detachModels
in class Component
public final void dirty()
public final void endComponentRender(Component component)
MarkupContainer
then the rendering for that container is checked.
component
- public final void expireOldestVersion()
public final int getAjaxVersionNumber()
public final short getAutoIndex()
public final int getCurrentVersionNumber()
public final java.lang.String getId()
Component
Component.getId()
public int getNumericId()
getNumericId
in interface IPageMapEntry
IPageMapEntry.getNumericId()
public final java.lang.Class getPageClass()
getPageClass
in interface IPageMapEntry
IPageMapEntry.getPageClass()
public final IPageMap getPageMap()
public IPageMapEntry getPageMapEntry()
public final java.lang.String getPageMapName()
public final long getSizeInBytes()
getSizeInBytes
in class Component
public final boolean getStatelessHint()
getStatelessHint
in class Component
Component.getStatelessHint()
public Page getVersion(int versionNumber)
versionNumber
- The version desired
public final int getVersions()
public final java.lang.String hierarchyAsString()
public final void ignoreVersionMerge()
public boolean isBookmarkable()
public boolean isErrorPage()
public final boolean isPageStateless()
public final void onRedirect()
onRedirect
in interface IRedirectListener
IRedirectListener.onRedirect()
public final void removePersistedFormData(java.lang.Class formClass, boolean disablePersistence)
formClass
- Form to be selected. Pages may have more than one Form.disablePersistence
- if true, disable persistence for all FormComponents on that page. If false, it
will remain unchanged.Form.removePersistentFormComponentValues(boolean)
public final void renderPage()
public final Page rollbackPage(int numberOfVersions)
numberOfVersions
- to rollback
public final void setNumericId(int id)
setNumericId
in interface IPageMapEntry
id
- The idpublic final void setStatelessHint(boolean value)
value
- whether the page should try to be statelesspublic final void startComponentRender(Component component)
component
- public java.lang.String toString()
toString
in class MarkupContainer
Component.toString()
protected void componentChanged(Component component, MarkupContainer parent)
component
- parent
- protected java.lang.Object writeReplace() throws java.io.ObjectStreamException
java.io.ObjectStreamException
protected void configureResponse()
Note: Prior to Wicket 1.1 the output encoding was determined by the page's markup encoding. Because this caused uncertainties about the /request/ encoding, it has been changed in favor of the new, much safer, approach. Please see the Wiki for more details.
protected final void internalOnModelChanged()
internalOnModelChanged
in class Component
Component.internalOnModelChanged()
protected final void moveToPageMap(IPageMap map)
map
- protected final IPageVersionManager newVersionManager()
protected void onBeforeRender()
Component
NOTE* If you override this, you *must* call super.onBeforeRender() within your
implementation.
Because this method is responsible for cascading Component.onBeforeRender()
call to its
children it is strongly recommended that super call is made at the end of the override.
onBeforeRender
in class Component
protected void onDetach()
Component
Component.onDetach()
protected void onRender(MarkupStream markupStream)
onRender
in class MarkupContainer
markupStream
- public void onPageAttached()
public java.lang.String getMarkupType()
MarkupContainer
getMarkupType
in class MarkupContainer
public PageReference getPageReference()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |