Class AbstractWizard<T extends Serializable>

  • Type Parameters:
    T - the model object type
    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.extensions.wizard.IWizard, org.apache.wicket.extensions.wizard.IWizardModelListener, 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

    public abstract class AbstractWizard<T extends Serializable>
    extends AbstractFormDialog<T>
    implements org.apache.wicket.extensions.wizard.IWizardModelListener, org.apache.wicket.extensions.wizard.IWizard
    Provides the base class for wizard-based 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 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
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean closeOnCancel()
      Indicates whether the wizard should close when onCancel() is triggered
      protected boolean closeOnFinish()
      Indicates whether the wizard should close when onFinish() is triggered
      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.
      protected DialogButton getCancelButton()
      Gets the button that is in charge to cancel to wizard.
      org.apache.wicket.markup.html.WebMarkupContainer getFeedbackPanel()
      Gets the wizard FeedbackPanel
      org.apache.wicket.markup.html.form.Form<?> getForm()
      Gets the form to be validated by this dialog.
      Warning, the onSubmit and the onError are being delegated to this dialog.
      protected org.apache.wicket.markup.html.form.Form<?> getForm​(DialogButton button)
      Returns the form associated to the button.
      It means that it will return the form if the supplied button is considered as a form submitter and null otherwise.
      DialogButton getSubmitButton()
      Gets the button that is in charge to submit the form.
      It should be in the list of buttons returned by AbstractDialog.getButtons()
      org.apache.wicket.extensions.wizard.IWizardModel getWizardModel()  
      protected void init​(org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
      Initialization
      protected org.apache.wicket.markup.html.WebMarkupContainer newFeedbackPanel​(String id)
      Gets a new FeedbackPanel
      protected org.apache.wicket.markup.html.form.Form<T> newForm​(String formId)
      Gets a new Form
      Caution: this method is called by ctors having the IWizardModel argument
      void onActiveStepChanged​(org.apache.wicket.extensions.wizard.IWizardStep step)  
      void onCancel()  
      protected void onCancel​(org.apache.wicket.ajax.AjaxRequestTarget target)
      Triggered when the wizard has been canceled
      void onClick​(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
      Triggered when a wizard button is clicked.
      void onConfigure​(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)

      Warning: autoOpen option is not supported
      protected void onConfigure​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Called when the wizard needs to be configured.
      protected void onError​(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
      Triggered when the form is submitted, but the validation failed
      void onFinish()  
      protected abstract void onFinish​(org.apache.wicket.ajax.AjaxRequestTarget target)
      Triggered when the wizard completes
      protected void onInitialize()  
      protected void onOpen​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Triggered when the dialog opens
      protected void onSubmit​(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
      Triggered when the form is submitted, and the validation succeed
      protected void reload​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Reloads the wizard, by calling onConfigure(IPartialPageRequestHandler) and re-attaching the form
      This method is called when, for instance, the wizard opens or the step changes.
      void renderHead​(org.apache.wicket.markup.head.IHeaderResponse response)  
      • 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, getMarkupTag, getMetaData, 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, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, 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

      • AbstractWizard

        public AbstractWizard​(String id,
                              String title)
        Constructor
        Parameters:
        id - the markup id
        title - the dialog's title
      • AbstractWizard

        public AbstractWizard​(String id,
                              org.apache.wicket.model.IModel<String> title)
        Constructor
        Parameters:
        id - the markup id
        title - the dialog's title
      • AbstractWizard

        public AbstractWizard​(String id,
                              String title,
                              org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
        Constructor
        Parameters:
        id - the markup id
        title - the dialog's title
        wizardModel - the IWizardModel
      • AbstractWizard

        public AbstractWizard​(String id,
                              org.apache.wicket.model.IModel<String> title,
                              org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
        Constructor
        Parameters:
        id - the markup id
        title - the dialog's title
        wizardModel - the IWizardModel
      • AbstractWizard

        public AbstractWizard​(String id,
                              String title,
                              boolean modal)
        Constructor
        Parameters:
        id - the markup id
        title - the dialog's title
        modal - indicates whether the dialog is modal
      • AbstractWizard

        public AbstractWizard​(String id,
                              org.apache.wicket.model.IModel<String> title,
                              boolean modal)
        Constructor
        Parameters:
        id - the markup id
        title - the dialog's title
        modal - indicates whether the dialog is modal
      • AbstractWizard

        public AbstractWizard​(String id,
                              String title,
                              org.apache.wicket.model.IModel<T> model,
                              boolean modal)
        Constructor
        Parameters:
        id - the markup id
        title - the dialog's title
        model - the dialog's model
        modal - indicates whether the dialog is modal
      • AbstractWizard

        public AbstractWizard​(String id,
                              org.apache.wicket.model.IModel<String> title,
                              org.apache.wicket.model.IModel<T> model,
                              boolean modal)
        Constructor
        Parameters:
        id - the markup id
        title - the dialog's title
        model - the dialog's model
        modal - indicates whether the dialog is modal
      • AbstractWizard

        public AbstractWizard​(String id,
                              String title,
                              org.apache.wicket.model.IModel<T> model)
        Constructor
        Parameters:
        id - the markup id
        title - the dialog's title
        model - the dialog's model
      • AbstractWizard

        public AbstractWizard​(String id,
                              org.apache.wicket.model.IModel<String> title,
                              org.apache.wicket.model.IModel<T> model)
        Constructor
        Parameters:
        id - the markup id
        title - the dialog's title
        model - the dialog's model
    • Method Detail

      • init

        protected final void init​(org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
        Initialization
        Parameters:
        wizardModel - the IWizardModel
      • renderHead

        public void renderHead​(org.apache.wicket.markup.head.IHeaderResponse response)
        Specified by:
        renderHead in interface org.apache.wicket.markup.html.IHeaderContributor
        Overrides:
        renderHead in class org.apache.wicket.Component
      • reload

        protected void reload​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Reloads the wizard, by calling onConfigure(IPartialPageRequestHandler) and re-attaching the form
        This method is called when, for instance, the wizard opens or the step changes.
        Parameters:
        handler - the IPartialPageRequestHandler
      • getFeedbackPanel

        public org.apache.wicket.markup.html.WebMarkupContainer getFeedbackPanel()
        Gets the wizard FeedbackPanel
        Returns:
        the FeedbackPanel
      • closeOnCancel

        protected boolean closeOnCancel()
        Indicates whether the wizard should close when onCancel() is triggered
        Returns:
        true by default
      • closeOnFinish

        protected boolean closeOnFinish()
        Indicates whether the wizard should close when onFinish() is triggered
        Returns:
        true by default
      • onConfigure

        public void onConfigure​(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)

        Warning: autoOpen option is not supported
        Specified by:
        onConfigure in interface com.googlecode.wicket.jquery.core.IJQueryWidget
        Overrides:
        onConfigure in class AbstractDialog<T extends Serializable>
      • onConfigure

        protected void onConfigure​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Called when the wizard needs to be configured.
        Parameters:
        handler - the IPartialPageRequestHandler
      • onOpen

        protected void onOpen​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Description copied from class: AbstractDialog
        Triggered when the dialog opens
        Overrides:
        onOpen in class AbstractDialog<T extends Serializable>
        Parameters:
        handler - the IPartialPageRequestHandler
      • onClick

        public final void onClick​(org.apache.wicket.ajax.AjaxRequestTarget target,
                                  DialogButton button)
        Triggered when a wizard button is clicked. If the button is a form-submitter button, the validation should have succeeded for this event to be triggered. This implementation overrides the default AbstractDialog.onClick(AjaxRequestTarget, DialogButton) implementation in order to not close the dialog.
        Specified by:
        onClick in interface IDialogListener
        Overrides:
        onClick in class AbstractDialog<T extends Serializable>
        Parameters:
        target - the AjaxRequestTarget
        button - the button that closed the dialog
      • onFinish

        public void onFinish()
        Specified by:
        onFinish in interface org.apache.wicket.extensions.wizard.IWizardModelListener
      • onCancel

        public void onCancel()
        Specified by:
        onCancel in interface org.apache.wicket.extensions.wizard.IWizardModelListener
      • onFinish

        protected abstract void onFinish​(org.apache.wicket.ajax.AjaxRequestTarget target)
        Triggered when the wizard completes
        Parameters:
        target - the AjaxRequestTarget
      • onCancel

        protected void onCancel​(org.apache.wicket.ajax.AjaxRequestTarget target)
        Triggered when the wizard has been canceled
        Parameters:
        target - the AjaxRequestTarget
      • getWizardModel

        public org.apache.wicket.extensions.wizard.IWizardModel getWizardModel()
        Specified by:
        getWizardModel in interface org.apache.wicket.extensions.wizard.IWizard
      • onActiveStepChanged

        public void onActiveStepChanged​(org.apache.wicket.extensions.wizard.IWizardStep step)
        Specified by:
        onActiveStepChanged in interface org.apache.wicket.extensions.wizard.IWizardModelListener
      • getButtons

        protected List<DialogButton> getButtons()
        Description copied from class: AbstractDialog
        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.
        Overrides:
        getButtons in class AbstractDialog<T extends Serializable>
        Returns:
        AbstractDialog.btnOk by default
      • getCancelButton

        protected DialogButton getCancelButton()
        Gets the button that is in charge to cancel to wizard.
        Returns:
        the cancel button
      • getForm

        public org.apache.wicket.markup.html.form.Form<?> getForm()
        Description copied from class: AbstractFormDialog
        Gets the form to be validated by this dialog.
        Warning, the onSubmit and the onError are being delegated to this dialog. However, it does not prevent the use of Form#onSubmit nor Form#onError
        Specified by:
        getForm in class AbstractFormDialog<T extends Serializable>
        Returns:
        the form
      • getForm

        protected org.apache.wicket.markup.html.form.Form<?> getForm​(DialogButton button)
        Returns the form associated to the button.
        It means that it will return the form if the supplied button is considered as a form submitter and null otherwise.
        This method may be overridden to specify other form-submitter buttons (ie: btnPrev)
        Overrides:
        getForm in class AbstractFormDialog<T extends Serializable>
        Parameters:
        button - the dialog's button
        Returns:
        the Form or null
      • newForm

        protected org.apache.wicket.markup.html.form.Form<T> newForm​(String formId)
        Gets a new Form
        Caution: this method is called by ctors having the IWizardModel argument
        Parameters:
        formId - the form id
        Returns:
        the form
      • newFeedbackPanel

        protected org.apache.wicket.markup.html.WebMarkupContainer newFeedbackPanel​(String id)
        Gets a new FeedbackPanel
        Parameters:
        id - the markup id
        Returns:
        a new JQueryFeedbackPanel by default