public abstract class AsyncUrlFragmentAwarePanel extends org.apache.wicket.markup.html.panel.Panel implements IBookmarkableComponent
Panel
which will receive the URL query and fragment parameters asynchronously
after the initial request.
After the initial request this panel executes an AJAX call (through a behavior) which invokes
#onParameterArrival(IRequestParameters, AjaxRequestTarget)
. This is a typical AJAX event
handling method with the difference that you have the URL query and fragment parameters, your
site was requested with, available in it. This method serves as your entry point for components
depending on URL fragment parameters.
Be aware the this panel will be rendered on the initial request in order to make the AJAX call. This means, that, before the fragment parameters arrive, your implementation has to have initial state (models) and content and cannot be invisible.
ENABLE, FLAG_AFTER_RENDERING, FLAG_INITIALIZED, FLAG_PREPARED_FOR_RENDER, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RENDERING, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING
Constructor and Description |
---|
AsyncUrlFragmentAwarePanel(String id) |
AsyncUrlFragmentAwarePanel(String id,
org.apache.wicket.model.IModel<?> model) |
Modifier and Type | Method and Description |
---|---|
void |
addFragmentParameter(String parameterName,
Object parameterValue,
String delimiter)
Deprecated.
|
protected Map<String,String> |
getOptions()
Returns a map of options used for initializing the JavaScript library for reading and writing
the URL fragment.
|
protected abstract void |
onParameterIncome(org.apache.wicket.request.IRequestParameters requestParameters,
org.apache.wicket.ajax.AjaxRequestTarget target)
This is where you can grab the URL query and fragment parameters, your site was requested
with.
|
void |
removeFragmentParameter(String parameterName)
Deprecated.
|
void |
renderHead(org.apache.wicket.markup.head.IHeaderResponse response) |
void |
setFragmentParameter(String parameterName,
Object parameterValue)
Deprecated.
|
protected UrlFragment |
urlFragment()
Returns a
UrlFragment connected to the current AjaxRequestTarget . |
getRegionMarkup, newMarkupSourcingStrategy
getWebPage, getWebRequest, getWebResponse, getWebSession
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onComponentTagBody, onDetach, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalPrepareForRender, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrap
public AsyncUrlFragmentAwarePanel(String id)
public AsyncUrlFragmentAwarePanel(String id, org.apache.wicket.model.IModel<?> model)
protected Map<String,String> getOptions()
Possible options are:
protected abstract void onParameterIncome(org.apache.wicket.request.IRequestParameters requestParameters, org.apache.wicket.ajax.AjaxRequestTarget target)
urlFragment()
inside this method.requestParameters
- target
- @Deprecated public void setFragmentParameter(String parameterName, Object parameterValue)
IBookmarkableComponent
AjaxRequestTarget
.
The parameter will be overwritten if it already exists.
setFragmentParameter
in interface IBookmarkableComponent
parameterName
- the name of your URL fragment parameter to setparameterValue
- the value of your URL fragment parameter to set@Deprecated public void addFragmentParameter(String parameterName, Object parameterValue, String delimiter)
IBookmarkableComponent
Use the following instead:
urlFragment().addParameter(parameterName, parameterValue, delimiter);
AjaxRequestTarget
.
The parameter will be created if it doesn't exists yet.
The value will be appended with the specified delimiter if the parameter already exists.
addFragmentParameter
in interface IBookmarkableComponent
parameterName
- the name of your URL fragment parameter to setparameterValue
- the value of your URL fragment parameter to setdelimiter
- the delimiter the given value will be appended with if the given parameter already
exists@Deprecated public void removeFragmentParameter(String parameterName)
IBookmarkableComponent
Use the following instead: urlFragment().removeParameter(parameterName);
AjaxRequestTarget
.removeFragmentParameter
in interface IBookmarkableComponent
parameterName
- the name of your URL fragment parameter to setpublic void renderHead(org.apache.wicket.markup.head.IHeaderResponse response)
renderHead
in interface org.apache.wicket.markup.html.IHeaderContributor
renderHead
in class org.apache.wicket.Component
protected UrlFragment urlFragment()
UrlFragment
connected to the current AjaxRequestTarget
. Use the
UrlFragment
to update the URL fragment in the browser after the current AJAX event.Copyright © 2015. All rights reserved.