org.wicketstuff.jquery.dnd
Class DnDBehaviour

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
                  extended by org.wicketstuff.jquery.dnd.DnDBehaviour
All Implemented Interfaces:
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

public class DnDBehaviour
extends JQueryBehavior
implements org.apache.wicket.behavior.IBehaviorListener

This implementation is really too simple, only supporting one drop-container etc, but it is an ok startingpoint to extend the functionality.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.wicketstuff.jquery.JQueryBehavior
INTERFACE_JS, JQUERY_BGIFRAME_JS, JQUERY_DEBUG_JS, JQUERY_JS, JQUERY_REGEXP, JQUERY_UI_JS
 
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
 
Fields inherited from interface org.apache.wicket.behavior.IBehaviorListener
INTERFACE
 
Constructor Summary
DnDBehaviour()
           
DnDBehaviour(Options draggableOptions, Options droppableOptions, String dragSelector, String dropSelector)
           
DnDBehaviour(String dragSelector, String dropSelector)
           
 
Method Summary
protected  CharSequence getCallbackScript()
           
 String getDropScript()
           
protected  CharSequence getOnReadyScript()
          to be override by subclass if need to run script when dom is ready.
 String getRebindScript()
           
 void onDrop(String srcId, String destId, org.apache.wicket.ajax.AjaxRequestTarget target)
           
 void renderHead(org.apache.wicket.markup.html.IHeaderResponse response)
           
 void respond(org.apache.wicket.ajax.AjaxRequestTarget target)
           
 
Methods inherited from class org.wicketstuff.jquery.JQueryBehavior
getIncludeJQueryJS, logger
 
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
findIndicatorId, generateCallbackScript, getAjaxCallDecorator, 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
 
Methods inherited from interface org.apache.wicket.behavior.IBehaviorListener
onRequest
 

Constructor Detail

DnDBehaviour

public DnDBehaviour()

DnDBehaviour

public DnDBehaviour(Options draggableOptions,
                    Options droppableOptions,
                    String dragSelector,
                    String dropSelector)
Parameters:
draggableOptions - (helper=clone to "leave a copy" of the object you are dragging. Doesn't work without helper argument.)
droppableOptions - (hoverClass=cssClass to set on hover over a droppable)
dropSelector - jquery selector setting what elements are droppable (example: #myListId li)
dragSelector - jquery selector setting what elements are draggable (example: .draggable)

DnDBehaviour

public DnDBehaviour(String dragSelector,
                    String dropSelector)
Parameters:
dropSelector - jquery selector setting what elements are droppable (example: #myListId li)
dragSelector - jquery selector setting what elements are draggable (example: .draggable)
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 JQueryBehavior

getDropScript

public String getDropScript()

respond

public final void respond(org.apache.wicket.ajax.AjaxRequestTarget target)
Overrides:
respond in class JQueryBehavior

getCallbackScript

protected CharSequence getCallbackScript()
Overrides:
getCallbackScript in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior

onDrop

public void onDrop(String srcId,
                   String destId,
                   org.apache.wicket.ajax.AjaxRequestTarget target)

getOnReadyScript

protected CharSequence getOnReadyScript()
Description copied from class: JQueryBehavior
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(){...}"

Overrides:
getOnReadyScript in class JQueryBehavior
Returns:
the script to execute when the dom is ready, or null (default)

getRebindScript

public String getRebindScript()


Copyright © 2012. All Rights Reserved.