org.apache.wicket.ajax
Class AjaxEventBehavior
java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.behavior.AbstractAjaxBehavior
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
org.apache.wicket.ajax.AjaxEventBehavior
- All Implemented Interfaces:
- Serializable, IBehaviorListener, IComponentAwareEventSink, IRequestListener, IComponentAwareHeaderContributor, IClusterable
- Direct Known Subclasses:
- AjaxFormComponentUpdatingBehavior, AjaxFormSubmitBehavior, AjaxPagingNavigationBehavior
public abstract class AjaxEventBehavior
- extends AbstractDefaultAjaxBehavior
An ajax behavior that is attached to a certain client-side (usually javascript) event, such as
click, change, keydown, etc.
Example:
WebMarkupContainer div=new WebMarkupContainer(...);
div.setOutputMarkupId(true);
div.add(new AjaxEventBehavior("click") {
protected void onEvent(AjaxRequestTarget target) {
System.out.println("ajax here!");
}
}
This behavior will be linked to the click javascript event of the div WebMarkupContainer
represents, and so anytime a user clicks this div the onEvent(AjaxRequestTarget)
of the
behavior is invoked.
- Since:
- 1.2
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
- Serialized Form
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior |
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, getChannel, getFailureScript, getPreconditionScript, getSuccessScript, onBind, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AjaxEventBehavior
public AjaxEventBehavior(String event)
- Construct.
- Parameters:
event
- the event this behavior will be attached to
renderHead
public void renderHead(Component component,
IHeaderResponse response)
- Description copied from class:
Behavior
- Render to the web response whatever the component wants to contribute to the head section.
- Specified by:
renderHead
in interface IComponentAwareHeaderContributor
- Overrides:
renderHead
in class AbstractDefaultAjaxBehavior
- Parameters:
component
- component which is contributing to the response. This parameter is here to give
the component as the context for component-awares implementing this interfaceresponse
- Response object- See Also:
Behavior.renderHead(Component,
org.apache.wicket.markup.head.IHeaderResponse)
updateAjaxAttributes
protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
- Description copied from class:
AbstractDefaultAjaxBehavior
- Gives a chance to the specializations to modify the attributes.
- Overrides:
updateAjaxAttributes
in class AbstractDefaultAjaxBehavior
onCheckEvent
protected void onCheckEvent(String event)
- Parameters:
event
- the event this behavior will be attached to
getEvent
public final String getEvent()
- Returns:
- event
the event this behavior is attached to
respond
protected final void respond(AjaxRequestTarget target)
- Specified by:
respond
in class AbstractDefaultAjaxBehavior
- Parameters:
target
- The AJAX target- See Also:
AbstractDefaultAjaxBehavior.respond(AjaxRequestTarget)
onEvent
protected abstract void onEvent(AjaxRequestTarget target)
- Listener method for the ajax event
- Parameters:
target
- the current request handler
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.