org.wicketstuff.jquery
Class JQueryBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.AbstractBehavior
      extended by org.apache.wicket.behavior.AbstractAjaxBehavior
          extended by org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
              extended by org.wicketstuff.jquery.JQueryBehavior
All Implemented Interfaces:
java.io.Serializable, org.apache.wicket.behavior.IBehavior, org.apache.wicket.behavior.IBehaviorListener, org.apache.wicket.behavior.IComponentConfigurationBehavior, org.apache.wicket.IClusterable, org.apache.wicket.IRequestListener, org.apache.wicket.markup.html.IHeaderContributor
Direct Known Subclasses:
CodepressBehaviour, CornerzBehaviour, CropBehaviour, DatePickerBehavior, DnDBehaviour, DnDSortableBehavior, JQueryLavaLampBehavior, LightboxBehaviour, ResizeBehaviour, SliderBehavior, TitleAsHintBehavior

public class JQueryBehavior
extends org.apache.wicket.ajax.AbstractDefaultAjaxBehavior

Author:
David Bernard (dwayne)
See Also:
Serialized Form

Field Summary
static org.apache.wicket.markup.html.resources.CompressedResourceReference INTERFACE_JS
          ResourceReference for interface-1.2.js (not include in reponse header)
static org.apache.wicket.markup.html.resources.CompressedResourceReference JQUERY_BGIFRAME_JS
          ResourceReference for jquery.bgiframe-2.1.1.js (not include in reponse header)
static org.apache.wicket.markup.html.resources.CompressedResourceReference JQUERY_DEBUG_JS
          ResourceReference for jquery.debug.js (include by default if wicket's configuration is "development")
static org.apache.wicket.markup.html.resources.CompressedResourceReference JQUERY_JS
          ResourceReference for jquery-1.2.6 (include by default when you add the current Behavior).
static java.util.regex.Pattern JQUERY_REGEXP
           
static org.apache.wicket.markup.html.resources.CompressedResourceReference JQUERY_UI_JS
          ResourceReference for jquery.ui containing core, resizable, draggable, droppable, selectable jquery-ui-personalized.js
 
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
 
Fields inherited from interface org.apache.wicket.behavior.IBehaviorListener
INTERFACE
 
Constructor Summary
JQueryBehavior()
           
 
Method Summary
 boolean getIncludeJQueryJS(org.apache.wicket.markup.html.IHeaderResponse response)
          to be overridden by subclass if you don't want to autodetect wether a jquery.js has already been added, and thus skip adding JQUERY_JS as a JavascriptReference.
protected  java.lang.CharSequence getOnReadyScript()
          to be override by subclass if need to run script when dom is ready.
protected  org.slf4j.Logger logger()
           
 void renderHead(org.apache.wicket.markup.html.IHeaderResponse response)
           
protected  void respond(org.apache.wicket.ajax.AjaxRequestTarget target)
           
 
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
findIndicatorId, generateCallbackScript, getAjaxCallDecorator, getCallbackScript, getCallbackScript, getChannelName, getFailureScript, getPreconditionScript, getSuccessScript, onBind, onRequest, throttleScript
 
Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior
bind, getCallbackUrl, getCallbackUrl, getComponent, getImplementationId, getStatelessHint, onComponentRendered, onComponentTag, onComponentTag, onRendered, onRenderHeadContribution, onRenderHeadInitContribution
 
Methods inherited from class org.apache.wicket.behavior.AbstractBehavior
afterRender, beforeRender, cleanup, detach, detachModel, exception, isEnabled, isTemporary, onConfigure, onException, rendered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JQUERY_JS

public static final org.apache.wicket.markup.html.resources.CompressedResourceReference JQUERY_JS
ResourceReference for jquery-1.2.6 (include by default when you add the current Behavior).


JQUERY_DEBUG_JS

public static final org.apache.wicket.markup.html.resources.CompressedResourceReference JQUERY_DEBUG_JS
ResourceReference for jquery.debug.js (include by default if wicket's configuration is "development")


INTERFACE_JS

public static final org.apache.wicket.markup.html.resources.CompressedResourceReference INTERFACE_JS
ResourceReference for interface-1.2.js (not include in reponse header)


JQUERY_UI_JS

public static final org.apache.wicket.markup.html.resources.CompressedResourceReference JQUERY_UI_JS
ResourceReference for jquery.ui containing core, resizable, draggable, droppable, selectable jquery-ui-personalized.js


JQUERY_BGIFRAME_JS

public static final org.apache.wicket.markup.html.resources.CompressedResourceReference JQUERY_BGIFRAME_JS
ResourceReference for jquery.bgiframe-2.1.1.js (not include in reponse header)


JQUERY_REGEXP

public static final java.util.regex.Pattern JQUERY_REGEXP
Constructor Detail

JQueryBehavior

public JQueryBehavior()
Method Detail

renderHead

public void renderHead(org.apache.wicket.markup.html.IHeaderResponse response)
Specified by:
renderHead in interface org.apache.wicket.markup.html.IHeaderContributor
Overrides:
renderHead in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior

getIncludeJQueryJS

public boolean getIncludeJQueryJS(org.apache.wicket.markup.html.IHeaderResponse response)
to be overridden by subclass if you don't want to autodetect wether a jquery.js has already been added, and thus skip adding JQUERY_JS as a JavascriptReference. You can either simply return false, or implement your own check to see if a jquery.js reference has been added either as a HeaderContributor or in a tag of some page in the hierarchy.

Parameters:
response - The IHeaderResponse, containing the rendered headers until now
Returns:
true if you want renderHead to include the JQUERY_JS in the head.

getOnReadyScript

protected java.lang.CharSequence getOnReadyScript()
to be override by subclass if need to run script when dom is ready. The returned script is wrapped by caller into <script> tag and the "$(document).ready(function(){...}"

Returns:
the script to execute when the dom is ready, or null (default)

respond

protected void respond(org.apache.wicket.ajax.AjaxRequestTarget target)
Specified by:
respond in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior

logger

protected org.slf4j.Logger logger()


Copyright © 2011. All Rights Reserved.