public class PluginRequestTarget
extends org.apache.wicket.ajax.AjaxRequestTarget
implements org.apache.wicket.ajax.AjaxRequestTarget.IListener
AjaxRequestTarget
that filters the list of
Component
s that have been added.
This implementation of the AjaxRequestTarget allows components to be added to the request target even when they are later on removed from the (visible) component tree. The default wicket way requires that the component that responds to an ajax request knows which components need to be redrawn and which changes are made in the component hierarchy.
For the CMS plugin framework, this coupling has been lifted using this extension, the PluginRequestTarget. In the processing of ajax requests, the action phase (invocation of the listener) marks components that need to be redrawn (see RenderService#redraw), that later on can actually register for rendering (IRenderService#render).
For regular wicket components, this is not an option. So for those are still able to rerender themselves after e.g. a model change. Since other plugins might change the hierarchy in response to the changes, the component might no longer be there during the rendering though. The PluginRequestTarget handles this case by discarding the component.
Constructor and Description |
---|
PluginRequestTarget(org.apache.wicket.Page page) |
Modifier and Type | Method and Description |
---|---|
void |
addComponent(org.apache.wicket.Component component) |
void |
addListener(org.apache.wicket.ajax.AjaxRequestTarget.IListener listener) |
boolean |
equals(Object obj) |
org.apache.wicket.markup.html.IHeaderResponse |
getHeaderResponse() |
int |
hashCode() |
void |
onAfterRespond(Map map,
org.apache.wicket.ajax.AjaxRequestTarget.IJavascriptResponse response) |
void |
onBeforeRespond(Map existing,
org.apache.wicket.ajax.AjaxRequestTarget target) |
addChildren, addComponent, addJavascript, appendJavascript, detach, encode, focusComponent, get, getComponents, getEncodingName, getLastFocusedElementId, getPage, needsEncoding, prependJavascript, registerRespondListener, respond, toString
public void addComponent(org.apache.wicket.Component component)
addComponent
in class org.apache.wicket.ajax.AjaxRequestTarget
public void addListener(org.apache.wicket.ajax.AjaxRequestTarget.IListener listener)
addListener
in class org.apache.wicket.ajax.AjaxRequestTarget
public void onBeforeRespond(Map existing, org.apache.wicket.ajax.AjaxRequestTarget target)
onBeforeRespond
in interface org.apache.wicket.ajax.AjaxRequestTarget.IListener
public void onAfterRespond(Map map, org.apache.wicket.ajax.AjaxRequestTarget.IJavascriptResponse response)
onAfterRespond
in interface org.apache.wicket.ajax.AjaxRequestTarget.IListener
public org.apache.wicket.markup.html.IHeaderResponse getHeaderResponse()
getHeaderResponse
in class org.apache.wicket.ajax.AjaxRequestTarget
public int hashCode()
hashCode
in class org.apache.wicket.ajax.AjaxRequestTarget
public boolean equals(Object obj)
equals
in class org.apache.wicket.ajax.AjaxRequestTarget
Copyright © 2007-2013 Hippo B.V. (http://www.onehippo.com). All Rights Reserved.