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

    Nested classes/interfaces inherited from class com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog

    AbstractFormDialog.DialogFormSubmitter

    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 com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog

    CANCEL, CLOSE, LBL_CANCEL, LBL_CLOSE, LBL_NO, LBL_OK, LBL_SUBMIT, LBL_YES, NO, OK, SUBMIT, 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, RFLAG_CONTAINER_HAS_REMOVALS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor
    AbstractWizard(String id, String title, boolean modal)
    Constructor
    AbstractWizard(String id, String title, org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
    Constructor
    AbstractWizard(String id, String title, org.apache.wicket.model.IModel<T> model)
    Constructor
    AbstractWizard(String id, String title, org.apache.wicket.model.IModel<T> model, boolean modal)
    Constructor
    AbstractWizard(String id, org.apache.wicket.model.IModel<String> title)
    Constructor
    AbstractWizard(String id, org.apache.wicket.model.IModel<String> title, boolean modal)
    Constructor
    AbstractWizard(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
    Constructor
    AbstractWizard(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model)
    Constructor
    AbstractWizard(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model, boolean modal)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    Indicates whether the wizard should close when onCancel() is triggered
    protected boolean
    Indicates whether the wizard should close when onFinish() is triggered
    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.
    protected DialogButton
    Gets the button that is in charge to cancel to wizard.
    org.apache.wicket.markup.html.WebMarkupContainer
    Gets the wizard FeedbackPanel
    org.apache.wicket.markup.html.form.Form<?>
    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<?>
    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.
    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
     
    protected final void
    init(org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
    Initialization
    protected org.apache.wicket.markup.html.WebMarkupContainer
    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
     
    protected void
    onCancel(org.apache.wicket.ajax.AjaxRequestTarget target)
    Triggered when the wizard has been canceled
    final 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
     
    protected abstract void
    onFinish(org.apache.wicket.ajax.AjaxRequestTarget target)
    Triggered when the wizard completes
    protected void
     
    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 com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog

    getDefaultFormProcessing, getModelComparator, newButtonAjaxBehavior, onClose, onModelChanged

    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 class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    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
  • Constructor Details

    • 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 Details

    • 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
    • onInitialize

      protected void onInitialize()
      Overrides:
      onInitialize in class AbstractFormDialog<T extends Serializable>
    • 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
    • onSubmit

      protected void onSubmit(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
      Description copied from class: AbstractFormDialog
      Triggered when the form is submitted, and the validation succeed
      Specified by:
      onSubmit in class AbstractFormDialog<T extends Serializable>
      Parameters:
      target - the AjaxRequestTarget
      button - the DialogButton that submitted the form
    • onError

      protected void onError(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
      Description copied from class: AbstractFormDialog
      Triggered when the form is submitted, but the validation failed
      Specified by:
      onError in class AbstractFormDialog<T extends Serializable>
      Parameters:
      target - the AjaxRequestTarget
      button - the DialogButton that submitted the form
    • 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
    • getSubmitButton

      public DialogButton getSubmitButton()
      Description copied from class: AbstractFormDialog
      Gets the button that is in charge to submit the form.
      It should be in the list of buttons returned by AbstractDialog.getButtons()
      Specified by:
      getSubmitButton in class AbstractFormDialog<T extends Serializable>
      Returns:
      the submit button
    • 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