org.apache.wicket.ajax.calldecorator
Class CancelEventIfNoAjaxDecorator

java.lang.Object
  extended by org.apache.wicket.ajax.calldecorator.AjaxPostprocessingCallDecorator
      extended by org.apache.wicket.ajax.calldecorator.CancelEventIfNoAjaxDecorator
All Implemented Interfaces:
java.io.Serializable, IAjaxCallDecorator, IClusterable

public final class CancelEventIfNoAjaxDecorator
extends AjaxPostprocessingCallDecorator

Decorator that can be used to cancel the regular action if ajax call was performed. This allows us to, for example, cancel the default anchor behavior (requesting href url) if an ajax call was made in the onclick event handler. Ajax call cannot be performed if javascript has been turned off or no compatible XmlHttpRequest object can be found. This decorator will make javascript return true if the ajax call was made, and false otherwise.

Since:
1.2
Author:
Igor Vaynberg (ivaynberg)
See Also:
AjaxFallbackLink, Serialized Form

Field Summary
 
Fields inherited from interface org.apache.wicket.ajax.IAjaxCallDecorator
WICKET_CALL_RESULT_VAR
 
Constructor Summary
CancelEventIfNoAjaxDecorator()
          Construct.
CancelEventIfNoAjaxDecorator(IAjaxCallDecorator delegate)
          Constructors that allows chaining of another decorator
 
Method Summary
 java.lang.CharSequence postDecorateScript(java.lang.CharSequence script)
          Decorates ajax call script
 
Methods inherited from class org.apache.wicket.ajax.calldecorator.AjaxPostprocessingCallDecorator
decorateOnFailureScript, decorateOnSuccessScript, decorateScript, postDecorateOnFailureScript, postDecorateOnSuccessScript
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CancelEventIfNoAjaxDecorator

public CancelEventIfNoAjaxDecorator()
Construct.


CancelEventIfNoAjaxDecorator

public CancelEventIfNoAjaxDecorator(IAjaxCallDecorator delegate)
Constructors that allows chaining of another decorator

Parameters:
delegate -
Method Detail

postDecorateScript

public final java.lang.CharSequence postDecorateScript(java.lang.CharSequence script)
Description copied from class: AjaxPostprocessingCallDecorator
Decorates ajax call script

Overrides:
postDecorateScript in class AjaxPostprocessingCallDecorator
Returns:
decorated script
See Also:
AjaxPostprocessingCallDecorator.postDecorateScript(CharSequence)


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