|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.behavior.AbstractBehavior
wicket.behavior.AbstractAjaxBehavior
wicket.ajax.AbstractDefaultAjaxBehavior
wicket.ajax.AjaxEventBehavior
public abstract class AjaxEventBehavior
An ajax behavior that is attached to a certain client-side (usually javascript) event, such as onClick, onChange, onKeyDown, etc.
Example:
DropDownChoice choice=new DropDownChoice(...);
choice.add(new AjaxEventBehavior("onchange") {
protected void onEvent(AjaxRequestTarget target) {
System.out.println("ajax here!");
}
}
This behavior will be linked to the onChange javascript event of the select
box this DropDownChoice represents, and so anytime a new option is selected
we will get the System.out message
| Field Summary |
|---|
| Fields inherited from class wicket.ajax.AbstractDefaultAjaxBehavior |
|---|
INDICATOR |
| Fields inherited from interface wicket.behavior.IBehaviorListener |
|---|
INTERFACE |
| Constructor Summary | |
|---|---|
AjaxEventBehavior(java.lang.String event)
Construct. |
|
| Method Summary | |
|---|---|
protected java.lang.CharSequence |
getCallbackScript(java.lang.CharSequence partialCall,
java.lang.CharSequence onSuccessScript,
java.lang.CharSequence onFailureScript)
Returns javascript that performs an ajax callback to this behavior. |
java.lang.String |
getEvent()
|
protected java.lang.CharSequence |
getEventHandler()
|
protected void |
onCheckEvent(java.lang.String event)
|
protected void |
onComponentTag(ComponentTag tag)
Called any time a component that has this handler registered is rendering the component tag. |
protected abstract void |
onEvent(AjaxRequestTarget target)
Listener method for the ajax event |
protected void |
respond(AjaxRequestTarget target)
|
AjaxEventBehavior |
setThrottleDelay(Duration throttleDelay)
Sets the throttle delay for this behavior. |
| Methods inherited from class wicket.ajax.AbstractDefaultAjaxBehavior |
|---|
getAjaxCallDecorator, getCallbackScript, getCallbackScript, getImplementationId, onBind, onRenderHeadInitContribution, onRequest, throttleScript |
| Methods inherited from class wicket.behavior.AbstractAjaxBehavior |
|---|
bind, cleanup, getCallbackUrl, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onRendered, onRenderHeadContribution, renderHead, writeJsReference, writeJsReference |
| Methods inherited from class wicket.behavior.AbstractBehavior |
|---|
detachModel, exception, onException, rendered |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AjaxEventBehavior(java.lang.String event)
event - event this behavior will be attached to| Method Detail |
|---|
public final AjaxEventBehavior setThrottleDelay(Duration throttleDelay)
For example, this is useful when attaching this behavior to the onkeypress event. It is not desirable to have an ajax call made every time the user types so we throttle that call to a desirable delay, such as once per second. This gives us a near real time ability to provide feedback without overloading the server with ajax calls.
throttleDelay - throttle delay
protected void onComponentTag(ComponentTag tag)
AbstractAjaxBehavior
onComponentTag in class AbstractAjaxBehaviortag - the tag that is renderedAbstractAjaxBehavior.onComponentTag(wicket.markup.ComponentTag)protected java.lang.CharSequence getEventHandler()
protected java.lang.CharSequence getCallbackScript(java.lang.CharSequence partialCall,
java.lang.CharSequence onSuccessScript,
java.lang.CharSequence onFailureScript)
AbstractDefaultAjaxBehaviorAbstractDefaultAjaxBehavior.getAjaxCallDecorator().
getCallbackScript in class AbstractDefaultAjaxBehaviorpartialCall - Javascript of a partial call to the function performing the
actual ajax callback. Must be in format
function(params, with signature
function(params, onSuccessHandler, onFailureHandler.
Example: wicketAjaxGet('callbackurl'onSuccessScript - javascript that will run when the ajax call finishes
successfullyonFailureScript - javascript that will run when the ajax call finishes with an
error status
protected void onCheckEvent(java.lang.String event)
event - public final java.lang.String getEvent()
protected final void respond(AjaxRequestTarget target)
respond in class AbstractDefaultAjaxBehaviortarget - The AJAX targetAbstractDefaultAjaxBehavior.respond(wicket.ajax.AjaxRequestTarget)protected abstract void onEvent(AjaxRequestTarget target)
target -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||