Class AbstractDialog<T extends Serializable>
java.lang.Object
org.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.panel.Panel
org.apache.wicket.markup.html.panel.GenericPanel<T>
com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog<T>
- Type Parameters:
T
- the type of the model object
- All Implemented Interfaces:
com.googlecode.wicket.jquery.core.IJQueryWidget
,IDialogListener
,Serializable
,Iterable<org.apache.wicket.Component>
,org.apache.wicket.event.IEventSink
,org.apache.wicket.event.IEventSource
,org.apache.wicket.feedback.IFeedbackContributor
,org.apache.wicket.IConverterLocator
,org.apache.wicket.IGenericComponent<T,
,org.apache.wicket.markup.html.panel.GenericPanel<T>> org.apache.wicket.IMetadataContext<Serializable,
,org.apache.wicket.Component> org.apache.wicket.IQueueRegion
,org.apache.wicket.markup.html.IHeaderContributor
,org.apache.wicket.request.component.IRequestableComponent
,org.apache.wicket.util.IHierarchical<org.apache.wicket.Component>
,org.apache.wicket.util.io.IClusterable
- Direct Known Subclasses:
AbstractFormDialog
,FragmentDialog
,MessageDialog
public abstract class AbstractDialog<T extends Serializable>
extends org.apache.wicket.markup.html.panel.GenericPanel<T>
implements com.googlecode.wicket.jquery.core.IJQueryWidget, IDialogListener
Base class for implementing jQuery dialogs
- Author:
- Sebastien Briquet - sebfz1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.googlecode.wicket.jquery.core.IJQueryWidget
com.googlecode.wicket.jquery.core.IJQueryWidget.JQueryWidget
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final org.apache.wicket.model.IModel<String>
static final org.apache.wicket.model.IModel<String>
static final org.apache.wicket.model.IModel<String>
static final org.apache.wicket.model.IModel<String>
static final org.apache.wicket.model.IModel<String>
static final org.apache.wicket.model.IModel<String>
static final String
static final String
static final String
static final String
Fields inherited from class org.apache.wicket.markup.html.panel.Panel
PANEL
Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractDialog
(String id, String title) ConstructorAbstractDialog
(String id, String title, boolean modal) ConstructorAbstractDialog
(String id, String title, org.apache.wicket.model.IModel<T> model) ConstructorAbstractDialog
(String id, String title, org.apache.wicket.model.IModel<T> model, boolean modal) ConstructorAbstractDialog
(String id, org.apache.wicket.model.IModel<String> title) ConstructorAbstractDialog
(String id, org.apache.wicket.model.IModel<String> title, boolean modal) ConstructorAbstractDialog
(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model) ConstructorAbstractDialog
(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model, boolean modal) Constructor -
Method Summary
Modifier and TypeMethodDescriptionfinal void
close
(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, DialogButton button) Closes the dialogs in ajax/websocket.findButton
(String name) Finds aDialogButton
- identified by its name - within the list of buttons returned bygetButtons()
protected List<DialogButton>
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 titleint
getWidth()
Gets the dialog's withboolean
Indicates whether the default close event (the click on the X-icon) is enabled If true, theIDialogListener.onClose(IPartialPageRequestHandler, DialogButton)
event will be triggered, with a nullDialogButton
boolean
Indicates whether the escape close event (pressing escape key) is enabled If true, theIDialogListener.onClose(IPartialPageRequestHandler, DialogButton)
event will be triggered, with a nullDialogButton
boolean
isModal()
Gets the modal flagboolean
Indicates whether the dialog is resizableprotected ButtonAjaxBehavior
newButtonAjaxBehavior
(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source, DialogButton button) Gets a newButtonAjaxBehavior
that will be called by the correspondingDialogButton
.
This method may be overridden to provide additional behaviorsprotected final IDialogListener
Gets a newIDialogListener
that allow to redirectIDialogListener.onClick(AjaxRequestTarget, DialogButton)
tointernalOnClick(AjaxRequestTarget, DialogButton)
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 untilsuper.onClick(event)
orclose(IPartialPageRequestHandler, DialogButton)
is called.void
onConfigure
(com.googlecode.wicket.jquery.core.JQueryBehavior behavior) protected void
onDetach()
protected void
protected void
onOpen
(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler) Triggered when the dialog opensfinal void
open
(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler) Opens the dialogs in ajax.void
Sets the dialog's title dynamicallyvoid
setTitle
(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, org.apache.wicket.model.IModel<String> title) Sets the dialog's title dynamicallyvoid
Sets the dialog's titleMethods inherited from class org.apache.wicket.markup.html.panel.Panel
getRegionMarkup, newMarkupSourcingStrategy
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
Methods inherited from class org.apache.wicket.MarkupContainer
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildren
Methods inherited from class org.apache.wicket.Component
add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, 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, getMarkupTag, 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, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.googlecode.wicket.jquery.ui.widget.dialog.IDialogListener
onClose
Methods inherited from interface org.apache.wicket.IGenericComponent
getDefaultModel, getDefaultModelObject, getModel, getModelObject, setDefaultModel, setDefaultModelObject, setModel, setModelObject
Methods inherited from interface org.apache.wicket.IQueueRegion
dequeue, newDequeueContext
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
OK
- See Also:
-
NO
- See Also:
-
YES
- See Also:
-
CLOSE
- See Also:
-
CANCEL
- See Also:
-
SUBMIT
- See Also:
-
LBL_OK
-
LBL_NO
-
LBL_YES
-
LBL_CLOSE
-
LBL_CANCEL
-
LBL_SUBMIT
-
-
Constructor Details
-
AbstractDialog
Constructor- Parameters:
id
- the markupId, an html div suffice to host a dialog.title
- the title of the dialog
-
AbstractDialog
Constructor- Parameters:
id
- the markupId, an html div suffice to host a dialog.title
- the title of the dialog
-
AbstractDialog
Constructor- Parameters:
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.
-
AbstractDialog
public AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model) Constructor- Parameters:
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.
-
AbstractDialog
Constructor- Parameters:
id
- the markupId, an html div suffice to host a dialog.title
- the title of the dialogmodal
- indicates whether the dialog is modal
-
AbstractDialog
Constructor- Parameters:
id
- the markupId, an html div suffice to host a dialog.title
- the title of the dialogmodal
- indicates whether the dialog is modal
-
AbstractDialog
public AbstractDialog(String id, String title, org.apache.wicket.model.IModel<T> model, boolean modal) Constructor- Parameters:
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 dialog
-
AbstractDialog
public AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model, boolean modal) Constructor- Parameters:
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 dialog
-
-
Method Details
-
onInitialize
protected void onInitialize()- Overrides:
onInitialize
in classorg.apache.wicket.MarkupContainer
-
onConfigure
public void onConfigure(com.googlecode.wicket.jquery.core.JQueryBehavior behavior) - Specified by:
onConfigure
in interfacecom.googlecode.wicket.jquery.core.IJQueryWidget
-
onBeforeRender
public void onBeforeRender(com.googlecode.wicket.jquery.core.JQueryBehavior behavior) - Specified by:
onBeforeRender
in interfacecom.googlecode.wicket.jquery.core.IJQueryWidget
-
onOpen
protected void onOpen(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler) Triggered when the dialog opens- Parameters:
handler
- theIPartialPageRequestHandler
-
onClick
Triggered when a button is clicked
This method may be overridden to handle button behaviors, but the dialog will not been closed untilsuper.onClick(event)
orclose(IPartialPageRequestHandler, DialogButton)
is called.- Specified by:
onClick
in interfaceIDialogListener
- Parameters:
target
- theAjaxRequestTarget
button
- the button that closed the dialog
-
onDetach
protected void onDetach()- Overrides:
onDetach
in classorg.apache.wicket.MarkupContainer
-
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.- Returns:
btnOk
by default
-
getWidth
public int getWidth()Gets the dialog's with- Returns:
WIDTH
by default
-
getTitle
Gets the dialog's title- Returns:
- the dialog's title
-
setTitle
Sets the dialog's title- Parameters:
title
- the dialog's title
-
setTitle
public void setTitle(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, String title) Sets the dialog's title dynamically- Parameters:
handler
- theIPartialPageRequestHandler
title
- the dialog's title
-
setTitle
public void setTitle(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, org.apache.wicket.model.IModel<String> title) Sets the dialog's title dynamically- Parameters:
handler
- theIPartialPageRequestHandler
title
- the dialog's title
-
isModal
public boolean isModal()Gets the modal flag- Returns:
- the modal flag supplied to the constructor by default
-
isResizable
public boolean isResizable()Indicates whether the dialog is resizable- Returns:
- false by default
-
isDefaultCloseEventEnabled
public boolean isDefaultCloseEventEnabled()Description copied from interface:IDialogListener
Indicates whether the default close event (the click on the X-icon) is enabled If true, theIDialogListener.onClose(IPartialPageRequestHandler, DialogButton)
event will be triggered, with a nullDialogButton
- Specified by:
isDefaultCloseEventEnabled
in interfaceIDialogListener
- Returns:
- false by default
-
isEscapeCloseEventEnabled
public boolean isEscapeCloseEventEnabled()Description copied from interface:IDialogListener
Indicates whether the escape close event (pressing escape key) is enabled If true, theIDialogListener.onClose(IPartialPageRequestHandler, DialogButton)
event will be triggered, with a nullDialogButton
- Specified by:
isEscapeCloseEventEnabled
in interfaceIDialogListener
- Returns:
- false by default
-
findButton
Finds aDialogButton
- identified by its name - within the list of buttons returned bygetButtons()
- Parameters:
name
- the button's name- Returns:
- the
DialogButton
if found, null otherwise
-
open
public final void open(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler) Opens the dialogs in ajax.- Parameters:
handler
- theIPartialPageRequestHandler
-
close
public final void close(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, DialogButton button) Closes the dialogs in ajax/websocket.- Parameters:
handler
- theIPartialPageRequestHandler
button
- the button that closes the dialog
-
newWidgetBehavior
- Specified by:
newWidgetBehavior
in interfacecom.googlecode.wicket.jquery.core.IJQueryWidget
- See Also:
-
IJQueryWidget.newWidgetBehavior(String)
-
newDialogListenerWrapper
Gets a newIDialogListener
that allow to redirectIDialogListener.onClick(AjaxRequestTarget, DialogButton)
tointernalOnClick(AjaxRequestTarget, DialogButton)
- Returns:
- a new
DialogListenerWrapper
-
newButtonAjaxBehavior
protected ButtonAjaxBehavior newButtonAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source, DialogButton button) Gets a newButtonAjaxBehavior
that will be called by the correspondingDialogButton
.
This method may be overridden to provide additional behaviors- Parameters:
source
- theIJQueryAjaxAware
sourcebutton
- the button that is passed to the behavior so it can be retrieved via theButtonAjaxBehavior.ClickEvent
- Returns:
- the
ButtonAjaxBehavior
-