public abstract class DialogBehavior extends JQueryUIBehavior implements com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware
Modifier and Type | Class and Description |
---|---|
protected static class |
DialogBehavior.CloseEvent
Provides an event object that will be broadcasted by the
DialogBehavior.OnDefaultCloseAjaxBehavior and the DialogBehavior.OnEscapeCloseAjaxBehavior callbacks |
protected static class |
DialogBehavior.OnDefaultCloseAjaxBehavior
Provides a
JQueryAjaxBehavior that aims to be wired to the 'close' eventUnderlying callback will be triggered when the user clicks on the X-icon |
protected static class |
DialogBehavior.OnEscapeCloseAjaxBehavior
Provides a
JQueryAjaxBehavior that aims to be wired to the 'beforeClose' eventUnderlying callback will be triggered when the user presses the escape key |
Constructor and Description |
---|
DialogBehavior(String selector)
Constructor
|
DialogBehavior(String selector,
com.googlecode.wicket.jquery.core.Options options)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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 |
boolean |
isEscapeCloseEventEnabled()
Indicates whether the escape close event (pressing escape key) is enabled
If true, the
onClose(AjaxRequestTarget, DialogButton) event will be triggered, with a null DialogButton |
protected abstract ButtonAjaxBehavior |
newButtonAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source,
DialogButton button)
Gets a new
ButtonAjaxBehavior that will be called by the corresponding DialogButton . |
protected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior |
newOnDefaultCloseAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
Gets a new
JQueryAjaxBehavior that will be wired to the 'close' event, triggered when the user clicks on the X-icon |
protected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior |
newOnEscapeCloseAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
Gets a new
JQueryAjaxBehavior that will be wired to the 'beforeClose' event, triggered when the user presses the escape key |
void |
onAjax(org.apache.wicket.ajax.AjaxRequestTarget target,
com.googlecode.wicket.jquery.core.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.
|
destroy, onDestroy, widget, widget
$, $, $, $, beforeRender, detach, getMethod, getOption, getOptions, getSelector, on, on, on, remove, renderHead, setOption, setOption, setOption, setOptions, setSelector
add, getJQueryLibrarySettings, getToken, renderScript, toString
public static final String METHOD
public DialogBehavior(String selector)
selector
- the html selector (ie: "#myId")public DialogBehavior(String selector, com.googlecode.wicket.jquery.core.Options options)
selector
- the html selector (ie: "#myId")options
- the Options
protected abstract List<DialogButton> getButtons()
public void bind(org.apache.wicket.Component component)
bind
in class org.apache.wicket.behavior.Behavior
public void open(org.apache.wicket.ajax.AjaxRequestTarget target)
target
- the AjaxRequestTarget
public void close(org.apache.wicket.ajax.AjaxRequestTarget target)
target
- the AjaxRequestTarget
public void onConfigure(org.apache.wicket.Component component)
onConfigure
in class JQueryUIBehavior
public void onAjax(org.apache.wicket.ajax.AjaxRequestTarget target, com.googlecode.wicket.jquery.core.JQueryEvent event)
onAjax
in interface com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware
protected abstract ButtonAjaxBehavior newButtonAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source, DialogButton button)
ButtonAjaxBehavior
that will be called by the corresponding DialogButton
.source
- the IJQueryAjaxAware
sourcebutton
- the button that is passed to the behavior so it can be retrieved via the ButtonAjaxBehavior.ClickEvent
ButtonAjaxBehavior
protected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior newOnDefaultCloseAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
JQueryAjaxBehavior
that will be wired to the 'close' event, triggered when the user clicks on the X-iconsource
- the IJQueryAjaxAware
DialogBehavior.OnDefaultCloseAjaxBehavior
by defaultprotected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior newOnEscapeCloseAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
JQueryAjaxBehavior
that will be wired to the 'beforeClose' event, triggered when the user presses the escape keysource
- the IJQueryAjaxAware
DialogBehavior.OnEscapeCloseAjaxBehavior
by defaultpublic boolean isDefaultCloseEventEnabled()
onClose(AjaxRequestTarget, DialogButton)
event will be triggered, with a null DialogButton
public boolean isEscapeCloseEventEnabled()
onClose(AjaxRequestTarget, DialogButton)
event will be triggered, with a null DialogButton
public void onClick(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
super.onClick(event)
or close(AjaxRequestTarget)
is called.target
- the AjaxRequestTarget
button
- the button that closed the dialogpublic void onClose(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
target
- the AjaxRequestTarget
button
- the button that closed the dialogCopyright © 2015 7thWeb. All rights reserved.