T
- the type of the model objectpublic abstract class AbstractDialog<T extends Serializable> extends org.apache.wicket.markup.html.panel.GenericPanel<T> implements com.googlecode.wicket.jquery.core.IJQueryWidget, IDialogListener
Modifier and Type | Field and Description |
---|---|
static String |
CANCEL |
static String |
CLOSE |
static org.apache.wicket.model.IModel<String> |
LBL_CANCEL |
static org.apache.wicket.model.IModel<String> |
LBL_CLOSE |
static org.apache.wicket.model.IModel<String> |
LBL_NO |
static org.apache.wicket.model.IModel<String> |
LBL_OK |
static org.apache.wicket.model.IModel<String> |
LBL_SUBMIT |
static org.apache.wicket.model.IModel<String> |
LBL_YES |
static String |
NO |
static String |
OK |
static String |
SUBMIT |
static String |
YES |
Constructor and Description |
---|
AbstractDialog(String id,
org.apache.wicket.model.IModel<String> title)
Constructor
|
AbstractDialog(String id,
org.apache.wicket.model.IModel<String> title,
boolean modal)
Constructor
|
AbstractDialog(String id,
org.apache.wicket.model.IModel<String> title,
org.apache.wicket.model.IModel<T> model)
Constructor
|
AbstractDialog(String id,
org.apache.wicket.model.IModel<String> title,
org.apache.wicket.model.IModel<T> model,
boolean modal)
Constructor
|
AbstractDialog(String id,
String title)
Constructor
|
AbstractDialog(String id,
String title,
boolean modal)
Constructor
|
AbstractDialog(String id,
String title,
org.apache.wicket.model.IModel<T> model)
Constructor
|
AbstractDialog(String id,
String title,
org.apache.wicket.model.IModel<T> model,
boolean modal)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
close(org.apache.wicket.ajax.AjaxRequestTarget target,
DialogButton button)
Closes the dialogs in ajax.
|
DialogButton |
findButton(String name)
Finds a
DialogButton - identified by its name - within the list of buttons returned by getButtons() |
protected List<DialogButton> |
getButtons()
Gets the dialog's buttons.
It is allowed to return a predefined list (ie: DialogButtons#OK_CANCEL#toList()) as long as the buttons state (enable and/or visible) are not modified Warning: It is not legal to create the buttons to be returned in this method. |
org.apache.wicket.model.IModel<String> |
getTitle()
Gets the dialog's title
|
int |
getWidth()
Gets the dialog's with
|
boolean |
isDefaultCloseEventEnabled()
Indicates whether the default close event (the click on the X-icon) is enabled
If true, the
IDialogListener.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
IDialogListener.onClose(AjaxRequestTarget, DialogButton) event will be triggered, with a null DialogButton |
boolean |
isModal()
Gets the modal flag
|
boolean |
isResizable()
Indicates whether the dialog is resizable
|
protected ButtonAjaxBehavior |
newButtonAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source,
DialogButton button)
Gets a new
ButtonAjaxBehavior that will be called by the corresponding DialogButton .This method may be overridden to provide additional behaviors |
DialogBehavior |
newWidgetBehavior(String selector) |
void |
onBeforeRender(com.googlecode.wicket.jquery.core.JQueryBehavior behavior) |
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, DialogButton) is called. |
void |
onConfigure(com.googlecode.wicket.jquery.core.JQueryBehavior behavior) |
protected void |
onDetach() |
protected void |
onInitialize() |
protected void |
onOpen(org.apache.wicket.ajax.AjaxRequestTarget target)
Triggered when the dialog opens
|
void |
open(org.apache.wicket.ajax.AjaxRequestTarget target)
Opens the dialogs in ajax.
|
void |
setTitle(org.apache.wicket.ajax.AjaxRequestTarget target,
org.apache.wicket.model.IModel<String> title)
Sets the dialog's title dynamically
|
void |
setTitle(org.apache.wicket.ajax.AjaxRequestTarget target,
String title)
Sets the dialog's title dynamically
|
void |
setTitle(org.apache.wicket.model.IModel<String> title)
Sets the dialog's title
|
getModel, getModelObject, setModel, setModelObject
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalPrepareForRender, internalRenderComponent, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
onClose
forEach, spliterator
public static final String OK
public static final String NO
public static final String YES
public static final String CLOSE
public static final String CANCEL
public static final String SUBMIT
public static final org.apache.wicket.model.IModel<String> LBL_OK
public static final org.apache.wicket.model.IModel<String> LBL_NO
public static final org.apache.wicket.model.IModel<String> LBL_YES
public static final org.apache.wicket.model.IModel<String> LBL_CLOSE
public static final org.apache.wicket.model.IModel<String> LBL_CANCEL
public static final org.apache.wicket.model.IModel<String> LBL_SUBMIT
public AbstractDialog(String id, String title)
id
- the markupId, an html div suffice to host a dialog.title
- the title of the dialogpublic AbstractDialog(String id, org.apache.wicket.model.IModel<String> title)
id
- the markupId, an html div suffice to host a dialog.title
- the title of the dialogpublic AbstractDialog(String id, String title, org.apache.wicket.model.IModel<T> model)
id
- the markupId, an html div suffice to host a dialog.title
- the title of the dialogmodel
- the model to be used in the dialog.public AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model)
id
- the markupId, an html div suffice to host a dialog.title
- the title of the dialogmodel
- the model to be used in the dialog.public AbstractDialog(String id, String title, boolean modal)
id
- the markupId, an html div suffice to host a dialog.title
- the title of the dialogmodal
- indicates whether the dialog is modalpublic AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, boolean modal)
id
- the markupId, an html div suffice to host a dialog.title
- the title of the dialogmodal
- indicates whether the dialog is modalpublic AbstractDialog(String id, String title, org.apache.wicket.model.IModel<T> model, boolean modal)
id
- markupId, an html div suffice to host a dialog.title
- the title of the dialogmodal
- indicates whether the dialog is modalmodel
- the model to be used in the dialogpublic AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model, boolean modal)
id
- markupId, an html div suffice to host a dialog.title
- the title of the dialogmodal
- indicates whether the dialog is modalmodel
- the model to be used in the dialogprotected void onInitialize()
onInitialize
in class org.apache.wicket.Component
public void onConfigure(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
onConfigure
in interface com.googlecode.wicket.jquery.core.IJQueryWidget
public void onBeforeRender(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
onBeforeRender
in interface com.googlecode.wicket.jquery.core.IJQueryWidget
protected void onOpen(org.apache.wicket.ajax.AjaxRequestTarget target)
target
- the AjaxRequestTarget
public void onClick(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
super.onClick(event)
or close(AjaxRequestTarget, DialogButton)
is called.onClick
in interface IDialogListener
target
- the AjaxRequestTarget
button
- the button that closed the dialogprotected void onDetach()
onDetach
in class org.apache.wicket.Component
protected List<DialogButton> getButtons()
btnOk
by defaultpublic int getWidth()
WIDTH
by defaultpublic org.apache.wicket.model.IModel<String> getTitle()
public void setTitle(org.apache.wicket.model.IModel<String> title)
title
- the dialog's titlepublic void setTitle(org.apache.wicket.ajax.AjaxRequestTarget target, String title)
target
- the AjaxRequestTarget
title
- the dialog's titlepublic void setTitle(org.apache.wicket.ajax.AjaxRequestTarget target, org.apache.wicket.model.IModel<String> title)
target
- the AjaxRequestTarget
title
- the dialog's titlepublic boolean isModal()
public boolean isResizable()
public boolean isDefaultCloseEventEnabled()
IDialogListener
IDialogListener.onClose(AjaxRequestTarget, DialogButton)
event will be triggered, with a null DialogButton
isDefaultCloseEventEnabled
in interface IDialogListener
public boolean isEscapeCloseEventEnabled()
IDialogListener
IDialogListener.onClose(AjaxRequestTarget, DialogButton)
event will be triggered, with a null DialogButton
isEscapeCloseEventEnabled
in interface IDialogListener
public DialogButton findButton(String name)
DialogButton
- identified by its name - within the list of buttons returned by getButtons()
name
- the button's nameDialogButton
if found, null otherwisepublic final void open(org.apache.wicket.ajax.AjaxRequestTarget target)
target
- the AjaxRequestTarget
public final void close(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
target
- the AjaxRequestTarget
button
- the button that closes the dialogpublic final DialogBehavior newWidgetBehavior(String selector)
newWidgetBehavior
in interface com.googlecode.wicket.jquery.core.IJQueryWidget
IJQueryWidget.newWidgetBehavior(String)
protected 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
Copyright © 2016 7thWeb. All rights reserved.