com.googlecode.wicket.jquery.ui.widget.dialog
Class DialogBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
          extended by com.googlecode.wicket.jquery.core.JQueryBehavior
              extended by com.googlecode.wicket.jquery.ui.widget.dialog.DialogBehavior
All Implemented Interfaces:
IJQueryAjaxAware, Serializable, org.apache.wicket.IClusterable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.markup.html.IComponentAwareHeaderContributor

public abstract class DialogBehavior
extends JQueryBehavior
implements IJQueryAjaxAware

Provides a jQuery dialog behavior.

Since:
1.2.3, 6.0.1
Author:
Sebastien Briquet - sebfz1
See Also:
Serialized Form

Nested Class Summary
protected static class DialogBehavior.ButtonAjaxBehavior
          Provides the JQueryAjaxBehavior being called by the button(s).
protected static class DialogBehavior.ClickEvent
          Provides a dialog event that will be transmitted to the dialog AbstractDialog
protected static class DialogBehavior.CloseEvent
          An event object that will be broadcasted when the user clicks on the X-icon
 
Field Summary
 
Fields inherited from class com.googlecode.wicket.jquery.core.JQueryBehavior
method, options, selector
 
Constructor Summary
DialogBehavior(String selector)
          Constructor
DialogBehavior(String selector, Options options)
          Constructor
 
Method Summary
 void bind(org.apache.wicket.Component component)
           
 void close(org.apache.wicket.ajax.AjaxRequestTarget target)
          Closes the dialogs in ajax.
protected abstract  List<DialogButton> getButtons()
          Gets the dialog's buttons.
 boolean isDefaultCloseEventEnabled()
          Indicates whether the default close event (the click on the X-icon) is enabled If true, the onClose(AjaxRequestTarget, DialogButton) event will be triggered, with a null DialogButton
protected abstract  DialogBehavior.ButtonAjaxBehavior newButtonAjaxBehavior(IJQueryAjaxAware source, DialogButton button)
          Gets a new ButtonAjaxBehavior that will be called by the corresponding dialog's button.
This method mays be overridden internally to provide another behavior;
protected  JQueryAjaxBehavior newDefaultCloseBehavior()
          Gets the ajax behavior that will be triggered when the user clicks on the X-icon
 void onAjax(org.apache.wicket.ajax.AjaxRequestTarget target, JQueryEvent event)
           
 void onClick(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
          Triggered when a button is clicked.
 void onClose(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
          Triggered when the dialog closes.
 void onConfigure(org.apache.wicket.Component component)
           
 void open(org.apache.wicket.ajax.AjaxRequestTarget target)
          Opens the dialogs in ajax.
 
Methods inherited from class com.googlecode.wicket.jquery.core.JQueryBehavior
$, $, $, getOption, on, on, renderHead, setOption, setOptions
 
Methods inherited from class com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
add, beforeRender, toString
 
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, canCallListenerInterface, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onEvent, onException, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DialogBehavior

public DialogBehavior(String selector)
Constructor

Parameters:
selector - the html selector (ie: "#myId")

DialogBehavior

public DialogBehavior(String selector,
                      Options options)
Constructor

Parameters:
selector - the html selector (ie: "#myId")
options - the Options
Method Detail

getButtons

protected abstract List<DialogButton> getButtons()
Gets the dialog's buttons.

Returns:
the List of Button

bind

public void bind(org.apache.wicket.Component component)
Overrides:
bind in class org.apache.wicket.behavior.Behavior

open

public void open(org.apache.wicket.ajax.AjaxRequestTarget target)
Opens the dialogs in ajax.

Parameters:
target - the AjaxRequestTarget

close

public void close(org.apache.wicket.ajax.AjaxRequestTarget target)
Closes the dialogs in ajax.

Parameters:
target - the AjaxRequestTarget

onConfigure

public void onConfigure(org.apache.wicket.Component component)
Overrides:
onConfigure in class org.apache.wicket.behavior.Behavior

onAjax

public void onAjax(org.apache.wicket.ajax.AjaxRequestTarget target,
                   JQueryEvent event)
Specified by:
onAjax in interface IJQueryAjaxAware

newButtonAjaxBehavior

protected abstract DialogBehavior.ButtonAjaxBehavior newButtonAjaxBehavior(IJQueryAjaxAware source,
                                                                           DialogButton button)
Gets a new ButtonAjaxBehavior that will be called by the corresponding dialog's button.
This method mays be overridden internally to provide another behavior;

Parameters:
button - the button that is passed to the behavior so it can be retrieved via the DialogBehavior.ClickEvent

newDefaultCloseBehavior

protected JQueryAjaxBehavior newDefaultCloseBehavior()
Gets the ajax behavior that will be triggered when the user clicks on the X-icon

Returns:
the JQueryAjaxBehavior

isDefaultCloseEventEnabled

public boolean isDefaultCloseEventEnabled()
Indicates whether the default close event (the click on the X-icon) is enabled If true, the onClose(AjaxRequestTarget, DialogButton) event will be triggered, with a null DialogButton

Returns:
false by default

onClick

public void onClick(org.apache.wicket.ajax.AjaxRequestTarget target,
                    DialogButton button)
Triggered when a button is clicked. This method may be overridden to handle button behaviors, but the dialog will not been closed until super.onClick(event) or close(AjaxRequestTarget) is called.

Parameters:
target - the AjaxRequestTarget
button - the button that closed the dialog

onClose

public void onClose(org.apache.wicket.ajax.AjaxRequestTarget target,
                    DialogButton button)
Triggered when the dialog closes.

Parameters:
target - the AjaxRequestTarget
button - the button that closed the dialog


Copyright © 2013 7thWeb. All Rights Reserved.