Class DialogBehavior
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
-
- com.googlecode.wicket.jquery.core.JQueryBehavior
-
- com.googlecode.wicket.jquery.ui.JQueryUIBehavior
-
- com.googlecode.wicket.jquery.ui.widget.dialog.DialogBehavior
-
- All Implemented Interfaces:
com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware
,JQueryDestroyListener.IDestroyable
,Serializable
,org.apache.wicket.IComponentAwareEventSink
,org.apache.wicket.markup.html.IComponentAwareHeaderContributor
,org.apache.wicket.util.io.IClusterable
public abstract class DialogBehavior extends JQueryUIBehavior implements com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware
Provides a jQuery dialog behavior.- Since:
- 1.2.3, 6.0.1
- Author:
- Sebastien Briquet - sebfz1
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DialogBehavior.CloseEvent
Provides an event object that will be broadcasted by theDialogBehavior.OnDefaultCloseAjaxBehavior
and theDialogBehavior.OnEscapeCloseAjaxBehavior
callbacksprotected static class
DialogBehavior.OnDefaultCloseAjaxBehavior
Provides aJQueryAjaxBehavior
that aims to be wired to the 'close' event
Underlying callback will be triggered when the user clicks on the X-iconprotected static class
DialogBehavior.OnEscapeCloseAjaxBehavior
Provides aJQueryAjaxBehavior
that aims to be wired to the 'beforeClose' event
Underlying callback will be triggered when the user presses the escape key
-
Constructor Summary
Constructors Constructor Description DialogBehavior(String selector, com.googlecode.wicket.jquery.core.Options options, IDialogListener listener)
ConstructorDialogBehavior(String selector, IDialogListener listener)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
bind(org.apache.wicket.Component component)
void
close(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
Closes the dialogs in ajax.protected abstract List<DialogButton>
getButtons()
Gets the dialog's buttons.protected abstract ButtonAjaxBehavior
newButtonAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source, DialogButton button)
Gets a newButtonAjaxBehavior
that will be called by the correspondingDialogButton
.protected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior
newOnDefaultCloseAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
Gets a newJQueryAjaxBehavior
that will be wired to the 'close' event, triggered when the user clicks on the X-iconprotected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior
newOnEscapeCloseAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
Gets a newJQueryAjaxBehavior
that will be wired to the 'beforeClose' event, triggered when the user presses the escape keyvoid
onAjax(org.apache.wicket.ajax.AjaxRequestTarget target, com.googlecode.wicket.jquery.core.JQueryEvent event)
void
onConfigure(org.apache.wicket.Component component)
void
open(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
Opens the dialogs in ajax.-
Methods inherited from class com.googlecode.wicket.jquery.ui.JQueryUIBehavior
destroy, onDestroy, widget, widget, widget, widget
-
Methods inherited from class com.googlecode.wicket.jquery.core.JQueryBehavior
$, $, $, $, beforeRender, detach, getMethod, getOption, getOptions, getSelector, off, on, on, register, remove, renderHead, setOption, setOption, setOption, setOptions, setSelector
-
Methods inherited from class com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
add, getJQueryLibrarySettings, renderOnDomReadyScript, renderPriorityHeaderItem, toString
-
-
-
-
Field Detail
-
METHOD
public static final String METHOD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DialogBehavior
public DialogBehavior(String selector, IDialogListener listener)
Constructor- Parameters:
selector
- the html selector (ie: "#myId")listener
- theIDialogListener
-
DialogBehavior
public DialogBehavior(String selector, com.googlecode.wicket.jquery.core.Options options, IDialogListener listener)
Constructor- Parameters:
selector
- the html selector (ie: "#myId")options
- theOptions
listener
- theIDialogListener
-
-
Method Detail
-
getButtons
protected abstract List<DialogButton> getButtons()
Gets the dialog's buttons.
-
bind
public void bind(org.apache.wicket.Component component)
- Overrides:
bind
in classorg.apache.wicket.behavior.Behavior
-
open
public void open(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
Opens the dialogs in ajax.- Parameters:
handler
- theIPartialPageRequestHandler
-
close
public void close(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
Closes the dialogs in ajax.- Parameters:
handler
- theIPartialPageRequestHandler
-
onConfigure
public void onConfigure(org.apache.wicket.Component component)
- Overrides:
onConfigure
in classJQueryUIBehavior
-
onAjax
public void onAjax(org.apache.wicket.ajax.AjaxRequestTarget target, com.googlecode.wicket.jquery.core.JQueryEvent event)
- Specified by:
onAjax
in interfacecom.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware
-
newButtonAjaxBehavior
protected abstract ButtonAjaxBehavior newButtonAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source, DialogButton button)
Gets a newButtonAjaxBehavior
that will be called by the correspondingDialogButton
.- Parameters:
source
- theIJQueryAjaxAware
sourcebutton
- the button that is passed to the behavior so it can be retrieved via theButtonAjaxBehavior.ClickEvent
- Returns:
- the
ButtonAjaxBehavior
-
newOnDefaultCloseAjaxBehavior
protected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior newOnDefaultCloseAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
Gets a newJQueryAjaxBehavior
that will be wired to the 'close' event, triggered when the user clicks on the X-icon- Parameters:
source
- theIJQueryAjaxAware
- Returns:
- a new
OnDefaultCloseAjaxBehavior
by default
-
newOnEscapeCloseAjaxBehavior
protected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior newOnEscapeCloseAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
Gets a newJQueryAjaxBehavior
that will be wired to the 'beforeClose' event, triggered when the user presses the escape key- Parameters:
source
- theIJQueryAjaxAware
- Returns:
- a new
OnEscapeCloseAjaxBehavior
by default
-
-