Class PageLink<T>

  extended by org.apache.wicket.Component
      extended by org.apache.wicket.MarkupContainer
          extended by org.apache.wicket.markup.html.WebMarkupContainer
              extended by
                  extended by<T>
                      extended by<T>
Type Parameters:
T - type of model object
All Implemented Interfaces:
Serializable, IClusterable, IConverterLocator, IRequestListener, ILinkListener

Deprecated. use BookmarkablePageLink or Link instead

public class PageLink<T>
extends Link<T>

Links to a given page via an object implementing the IPageLink delayed linking interface. PageLinks can be constructed directly with an IPageLink interface or with a Page Class object. In the latter case, an IPageLink implementation is provided which constructs a Page of the given class when the link is clicked. A default no-args constructor must be available in this case or a WicketRuntimeException will be thrown when Wicket fails to instantiate the class. TODO 1.5: remove

Jonathan Locke
See Also:
IPageLink, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.apache.wicket.Component
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor<T extends Component>, Component.VisibilityChange
Field Summary
Fields inherited from class org.apache.wicket.Component
Fields inherited from interface
Constructor Summary
PageLink(String id, Class<C> c)
          Deprecated. Constructs a link that instantiates the given Page class when the link is clicked.
PageLink(String id, IPageLink pageLink)
          Deprecated. This constructor is ideal for constructing pages lazily.
PageLink(String id, Page page)
          Deprecated. rather than using this class/ constructor, use normal links and call setResponsePage in their onClick methods.
Method Summary
 Class<? extends Page> getPageClass()
          Deprecated. Retrieves the class of page this link links to.
 boolean linksTo(Page page)
          Deprecated. Returns true if the given page is of the same class as the (delayed) destination of this page link.
 void onClick()
          Deprecated. Handles a link click by asking for a concrete Page instance through the IPageLink.getPage() delayed linking interface.
Methods inherited from class
appendAnchor, getAnchor, getAutoEnable, getModel, getModelObject, getOnClickScript, getOnClickScript, getPopupSettings, getStatelessHint, getURL, isEnabled, onComponentTag, onLinkClicked, setAnchor, setAutoEnable, setModel, setModelObject, setPopupSettings
Methods inherited from class
disableLink, getAfterDisabledLink, getBeforeDisabledLink, isLinkEnabled, onBeforeRender, onComponentTagBody, setAfterDisabledLink, setBeforeDisabledLink
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getMarkupType, getWebPage, getWebRequest
Methods inherited from class org.apache.wicket.MarkupContainer
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onAfterRenderChildren, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, renderNext, replace, setDefaultModel, setMarkupStream, size, swap, toString, toString, visitChildren, visitChildren
Methods inherited from class org.apache.wicket.Component
add, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviors, getBehaviors, getBehaviorsRawList, getClassRelativePath, getComponentBorder, getConverter, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdImpl, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalAttach, internalDetach, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isAttached, isBehaviorAccepted, isEnableAllowed, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markAttached, markRendering, modelChanged, modelChanging, onAfterRender, onAttach, onBeginRequest, onConfigure, onDetach, onEndRequest, onInitialize, onModelChanged, onModelChanging, onRemove, prepareForRender, prepareForRender, redirectToInterceptPage, remove, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, setAuto, setComponentBorder, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public PageLink(String id,
                Class<C> c)
Constructs a link that instantiates the given Page class when the link is clicked. The instantiated Page is used to render a response to the user.

Type Parameters:
C -
id - See Component
c - Page class


public PageLink(String id,
                IPageLink pageLink)
This constructor is ideal for constructing pages lazily. Constructs a link which invokes the getPage() method of the IPageLink interface when the link is clicked. Whatever Page objects is returned by this method will be rendered back to the user.

id - See Component
pageLink - An implementation of IPageLink which will create the page linked to if and when this hyperlink is clicked at a later time.


public PageLink(String id,
                           Page page)
Deprecated. rather than using this class/ constructor, use normal links and call setResponsePage in their onClick methods.

This constructor is ideal if a Page object was passed in from a previous Page. Construct a link to the Page. Warning: DO NOT use this for constructing links to pages you didn't already have an instance of. This constructor is strongly discouraged for anything other than linking back to the same page.

id - See component
page - The page
Method Detail


public Class<? extends Page> getPageClass()
Retrieves the class of page this link links to.

page of class


public boolean linksTo(Page page)
Returns true if the given page is of the same class as the (delayed) destination of this page link.

linksTo in class Link<T>
page - A page
True if this link goes to the given page
See Also:


public void onClick()
Handles a link click by asking for a concrete Page instance through the IPageLink.getPage() delayed linking interface. This call will normally cause the destination page to be created.

Specified by:
onClick in class Link<T>
See Also:

Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.