|
||||||||||
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).
Page has the following differences to Component
s main concepts:
Session
and
increment for each new page. This numerical identifier is used as the component identifier
accessible via getId()
.IPageManager
. PageParameters
argument (which wraps any
query string parameters for a request). In case the page has both constructors, the constructor
with PageParameters will be used.Component.setVersioned(boolean)
. By default all pages are versioned if not configured differently
in IPageSettings.setVersionPagesByDefault(boolean)
WebPage
,
MarkupContainer
,
CompoundPropertyModel
,
Component
,
Serialized FormField Summary |
---|
Fields inherited from class org.apache.wicket.Component |
---|
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER |
Fields inherited from interface org.apache.wicket.IRedirectListener |
---|
INTERFACE |
Constructor Summary | |
---|---|
protected |
Page()
Constructor. |
protected |
Page(IModel<?> model)
Constructor. |
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 | |
---|---|
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. |
void |
detachModels()
Detaches any attached models referenced by this page. |
void |
dirty()
|
void |
dirty(boolean isInitialization)
Mark this page as modified in the session. |
void |
endComponentRender(Component component)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
int |
getAutoIndex()
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
String |
getId()
Gets the id of this component. |
MarkupType |
getMarkupType()
Get the type of associated markup for this component. |
Class<? extends Page> |
getPageClass()
|
int |
getPageId()
|
PageParameters |
getPageParameters()
The PageParameters object that was used to construct this page. |
PageReference |
getPageReference()
Gets page instance's unique identifier |
int |
getRenderCount()
Returns the number of times this page has been rendered. |
long |
getSizeInBytes()
|
boolean |
getStatelessHint()
Returns whether the page should try to be stateless. |
String |
hierarchyAsString()
|
protected void |
internalOnModelChanged()
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
internalPrepareForRender(boolean setRenderingFlag)
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 |
onAfterRender()
Called just after a component is rendered. |
protected void |
onBeforeRender()
Called just before a component is rendered. |
protected void |
onDetach()
Called to allow a component to detach resources after use. |
void |
onRedirect()
Redirect to this page. |
protected void |
onRender()
Implementation that renders this component. |
void |
renderPage()
Renders the page |
boolean |
setFreezePageId(boolean freeze)
Sets whether or not the page is allowed to change its page id. |
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 |
setWasCreatedBookmarkable(boolean wasCreatedBookmarkable)
Sets the flag that determins whether or not this page was created using one of its bookmarkable constructors |
void |
startComponentRender(Component component)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
String |
toString()
Get the string representation of this container. |
boolean |
wasCreatedBookmarkable()
Checks if this page was created using one of its bookmarkable constructors |
boolean |
wasRendered(Component component)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
Methods inherited from class org.apache.wicket.MarkupContainer |
---|
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, visitChildren, visitChildren, 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.request.component.IRequestableComponent |
---|
detach, get, getBehaviorById, getBehaviorId, getPage, getPageRelativePath |
Methods inherited from interface org.apache.wicket.page.IManageablePage |
---|
detach |
Constructor Detail |
---|
protected Page()
protected Page(IModel<?> model)
model
- 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
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
getPageParameters
in interface IRequestablePage
PageParameters
The construction page parameterpublic final void componentRendered(Component component)
component
- The component that was renderedpublic void detachModels()
detachModels
in class Component
public void internalPrepareForRender(boolean setRenderingFlag)
Component
Prepares the component and it's children for rendering. On whole page render this method must be called on the page. On AJAX request, this method must be called on the updated component.
internalPrepareForRender
in class Component
setRenderingFlag
- Whether to set the rendering flag. This must be true if the page is about to be
rendered. However, there are usecases to call this method without an immediate
render (e.g. on stateless listener request target to build the component
hierarchy), in that case setRenderingFlag should be false.Component.internalPrepareForRender(boolean)
public final void dirty()
dirty(boolean)
public boolean setFreezePageId(boolean freeze)
setFreezePageId
in interface IManageablePage
public void dirty(boolean isInitialization)
page store
isInitialization
- a flag whether this is a page instantiationpublic final void endComponentRender(Component component)
MarkupContainer
then the rendering for that container is checked.
component
- public final int getAutoIndex()
public final String getId()
Component
getId
in interface IRequestableComponent
getId
in class Component
Component.getId()
public final Class<? extends Page> getPageClass()
public final long getSizeInBytes()
getSizeInBytes
in class Component
public final boolean getStatelessHint()
getStatelessHint
in class Component
Component.getStatelessHint()
public final String hierarchyAsString()
public boolean isBookmarkable()
isBookmarkable
in interface IRequestablePage
public boolean isErrorPage()
public final boolean isPageStateless()
isPageStateless
in interface IManageablePage
public final void onRedirect()
onRedirect
in interface IRedirectListener
IRedirectListener.onRedirect()
public final void setNumericId(int id)
id
- The idpublic final void setStatelessHint(boolean value)
value
- whether the page should try to be statelesspublic final void startComponentRender(Component component)
component
- public String toString()
toString
in class MarkupContainer
Component.toString()
protected void componentChanged(Component component, MarkupContainer parent)
component
- parent
- protected final void internalOnModelChanged()
internalOnModelChanged
in class Component
Component.internalOnModelChanged()
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
Component.onBeforeRender()
protected void onAfterRender()
Component
onAfterRender
in class Component
Component.onAfterRender()
protected void onDetach()
Component
onDetach
in class Component
Component.onDetach()
protected void onRender()
Component
onRender
in class MarkupContainer
MarkupContainer.onRender()
public MarkupType getMarkupType()
MarkupContainer
getMarkupType
in class MarkupContainer
MarkupContainer.getMarkupType()
public PageReference getPageReference()
public int getPageId()
getPageId
in interface IManageablePage
IManageablePage.getPageId()
public int getRenderCount()
IRequestablePage
For example a same page might have been rendered in two separate tabs. Page render doesn't change page id but it can modify component hierarchy. Listener interface links on such page should only work in tab where the page was rendered most recently.
getRenderCount
in interface IRequestablePage
IRequestablePage.getRenderCount()
public final void setWasCreatedBookmarkable(boolean wasCreatedBookmarkable)
wasCreatedBookmarkable
- public final boolean wasCreatedBookmarkable()
wasCreatedBookmarkable
in interface IRequestablePage
true
if this page has been created by a bookmarkable URL,
false
otherwise.IRequestablePage.wasCreatedBookmarkable()
public void renderPage()
IRequestablePage
renderPage
in interface IRequestablePage
IRequestablePage.renderPage()
public final boolean wasRendered(Component component)
component
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |