Class AbstractDialog<T extends Serializable>

  • 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:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.googlecode.wicket.jquery.core.IJQueryWidget

        com.googlecode.wicket.jquery.core.IJQueryWidget.JQueryWidget
    • Field Summary

      Fields 
      Modifier and Type Field 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  
      • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, DialogButton button)
      Closes the dialogs in ajax/websocket.
      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(IPartialPageRequestHandler, 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(IPartialPageRequestHandler, 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
      protected IDialogListener newDialogListenerWrapper()
      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(IPartialPageRequestHandler, DialogButton) is called.
      void onConfigure​(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)  
      protected void onDetach()  
      protected void onInitialize()  
      protected void onOpen​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Triggered when the dialog opens
      void open​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Opens the dialogs in ajax.
      void setTitle​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, String title)
      Sets the dialog's title dynamically
      void setTitle​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, org.apache.wicket.model.IModel<String> title)
      Sets the dialog's title dynamically
      void setTitle​(org.apache.wicket.model.IModel<String> title)
      Sets the dialog's title
      • Methods 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, 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 interface org.apache.wicket.IGenericComponent

        getDefaultModel, getDefaultModelObject, getModel, getModelObject, setDefaultModel, setDefaultModelObject, setModel, setModelObject
      • Methods inherited from interface org.apache.wicket.IQueueRegion

        dequeue, newDequeueContext
    • Constructor Detail

      • AbstractDialog

        public AbstractDialog​(String id,
                              String title)
        Constructor
        Parameters:
        id - the markupId, an html div suffice to host a dialog.
        title - the title of the dialog
      • AbstractDialog

        public AbstractDialog​(String id,
                              org.apache.wicket.model.IModel<String> title)
        Constructor
        Parameters:
        id - the markupId, an html div suffice to host a dialog.
        title - the title of the dialog
      • AbstractDialog

        public AbstractDialog​(String id,
                              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 dialog
        model - 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 dialog
        model - the model to be used in the dialog.
      • AbstractDialog

        public AbstractDialog​(String id,
                              String title,
                              boolean modal)
        Constructor
        Parameters:
        id - the markupId, an html div suffice to host a dialog.
        title - the title of the dialog
        modal - indicates whether the dialog is modal
      • AbstractDialog

        public AbstractDialog​(String id,
                              org.apache.wicket.model.IModel<String> title,
                              boolean modal)
        Constructor
        Parameters:
        id - the markupId, an html div suffice to host a dialog.
        title - the title of the dialog
        modal - 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 dialog
        modal - indicates whether the dialog is modal
        model - 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 dialog
        modal - indicates whether the dialog is modal
        model - the model to be used in the dialog
    • Method Detail

      • onInitialize

        protected void onInitialize()
        Overrides:
        onInitialize in class org.apache.wicket.MarkupContainer
      • onConfigure

        public void onConfigure​(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
        Specified by:
        onConfigure in interface com.googlecode.wicket.jquery.core.IJQueryWidget
      • onBeforeRender

        public void onBeforeRender​(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
        Specified by:
        onBeforeRender in interface com.googlecode.wicket.jquery.core.IJQueryWidget
      • onOpen

        protected void onOpen​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Triggered when the dialog opens
        Parameters:
        handler - the IPartialPageRequestHandler
      • 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(IPartialPageRequestHandler, DialogButton) is called.
        Specified by:
        onClick in interface IDialogListener
        Parameters:
        target - the AjaxRequestTarget
        button - the button that closed the dialog
      • onDetach

        protected void onDetach()
        Overrides:
        onDetach in class org.apache.wicket.MarkupContainer
      • 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.
        Returns:
        btnOk by default
      • getWidth

        public int getWidth()
        Gets the dialog's with
        Returns:
        WIDTH by default
      • getTitle

        public org.apache.wicket.model.IModel<String> getTitle()
        Gets the dialog's title
        Returns:
        the dialog's title
      • setTitle

        public void setTitle​(org.apache.wicket.model.IModel<String> title)
        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 - the IPartialPageRequestHandler
        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 - the IPartialPageRequestHandler
        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
      • open

        public final void open​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Opens the dialogs in ajax.
        Parameters:
        handler - the IPartialPageRequestHandler
      • close

        public final void close​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler,
                                DialogButton button)
        Closes the dialogs in ajax/websocket.
        Parameters:
        handler - the IPartialPageRequestHandler
        button - the button that closes the dialog
      • newWidgetBehavior

        public DialogBehavior newWidgetBehavior​(String selector)
        Specified by:
        newWidgetBehavior in interface com.googlecode.wicket.jquery.core.IJQueryWidget
        See Also:
        IJQueryWidget.newWidgetBehavior(String)