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>
-
- com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog<T>
-
- com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog<T>
-
- com.googlecode.wicket.jquery.ui.widget.wizard.AbstractWizard<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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog
AbstractFormDialog.DialogFormSubmitter
-
-
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
-
-
Constructor Summary
Constructors Constructor Description AbstractWizard(String id, String title)
ConstructorAbstractWizard(String id, String title, boolean modal)
ConstructorAbstractWizard(String id, String title, org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
ConstructorAbstractWizard(String id, String title, org.apache.wicket.model.IModel<T> model)
ConstructorAbstractWizard(String id, String title, org.apache.wicket.model.IModel<T> model, boolean modal)
ConstructorAbstractWizard(String id, org.apache.wicket.model.IModel<String> title)
ConstructorAbstractWizard(String id, org.apache.wicket.model.IModel<String> title, boolean modal)
ConstructorAbstractWizard(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
ConstructorAbstractWizard(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model)
ConstructorAbstractWizard(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model, boolean modal)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
closeOnCancel()
Indicates whether the wizard should close whenonCancel()
is triggeredprotected boolean
closeOnFinish()
Indicates whether the wizard should close whenonFinish()
is triggeredprotected 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 wizardFeedbackPanel
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 byAbstractDialog.getButtons()
org.apache.wicket.extensions.wizard.IWizardModel
getWizardModel()
protected void
init(org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
Initializationprotected org.apache.wicket.markup.html.WebMarkupContainer
newFeedbackPanel(String id)
Gets a newFeedbackPanel
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 canceledvoid
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 supportedprotected 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 failedvoid
onFinish()
protected abstract void
onFinish(org.apache.wicket.ajax.AjaxRequestTarget target)
Triggered when the wizard completesprotected void
onInitialize()
protected void
onOpen(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
Triggered when the dialog opensprotected void
onSubmit(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
Triggered when the form is submitted, and the validation succeedprotected void
reload(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
Reloads the wizard, by callingonConfigure(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 com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog
close, findButton, getTitle, getWidth, isDefaultCloseEventEnabled, isEscapeCloseEventEnabled, isModal, isResizable, newDialogListenerWrapper, newWidgetBehavior, onBeforeRender, onDetach, open, setTitle, setTitle, setTitle
-
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 java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
AbstractWizard
public AbstractWizard(String id, String title)
Constructor- Parameters:
id
- the markup idtitle
- the dialog's title
-
AbstractWizard
public AbstractWizard(String id, org.apache.wicket.model.IModel<String> title)
Constructor- Parameters:
id
- the markup idtitle
- the dialog's title
-
AbstractWizard
public AbstractWizard(String id, String title, org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
Constructor- Parameters:
id
- the markup idtitle
- the dialog's titlewizardModel
- theIWizardModel
-
AbstractWizard
public AbstractWizard(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
Constructor- Parameters:
id
- the markup idtitle
- the dialog's titlewizardModel
- theIWizardModel
-
AbstractWizard
public AbstractWizard(String id, String title, boolean modal)
Constructor- Parameters:
id
- the markup idtitle
- the dialog's titlemodal
- 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 idtitle
- the dialog's titlemodal
- 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 idtitle
- the dialog's titlemodel
- the dialog's modelmodal
- 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 idtitle
- the dialog's titlemodel
- the dialog's modelmodal
- 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 idtitle
- the dialog's titlemodel
- the dialog's model
-
-
Method Detail
-
init
protected final void init(org.apache.wicket.extensions.wizard.IWizardModel wizardModel)
Initialization- Parameters:
wizardModel
- theIWizardModel
-
renderHead
public void renderHead(org.apache.wicket.markup.head.IHeaderResponse response)
- Specified by:
renderHead
in interfaceorg.apache.wicket.markup.html.IHeaderContributor
- Overrides:
renderHead
in classorg.apache.wicket.Component
-
reload
protected void reload(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
Reloads the wizard, by callingonConfigure(IPartialPageRequestHandler)
and re-attaching the form
This method is called when, for instance, the wizard opens or the step changes.- Parameters:
handler
- theIPartialPageRequestHandler
-
getFeedbackPanel
public org.apache.wicket.markup.html.WebMarkupContainer getFeedbackPanel()
Gets the wizardFeedbackPanel
- Returns:
- the
FeedbackPanel
-
closeOnCancel
protected boolean closeOnCancel()
Indicates whether the wizard should close whenonCancel()
is triggered- Returns:
true
by default
-
closeOnFinish
protected boolean closeOnFinish()
Indicates whether the wizard should close whenonFinish()
is triggered- Returns:
true
by default
-
onInitialize
protected void onInitialize()
- Overrides:
onInitialize
in classAbstractFormDialog<T extends Serializable>
-
onConfigure
public void onConfigure(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
Warning:autoOpen
option is not supported- Specified by:
onConfigure
in interfacecom.googlecode.wicket.jquery.core.IJQueryWidget
- Overrides:
onConfigure
in classAbstractDialog<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
- theIPartialPageRequestHandler
-
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 classAbstractDialog<T extends Serializable>
- Parameters:
handler
- theIPartialPageRequestHandler
-
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 defaultAbstractDialog.onClick(AjaxRequestTarget, DialogButton)
implementation in order to not close the dialog.- Specified by:
onClick
in interfaceIDialogListener
- Overrides:
onClick
in classAbstractDialog<T extends Serializable>
- Parameters:
target
- theAjaxRequestTarget
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 classAbstractFormDialog<T extends Serializable>
- Parameters:
target
- theAjaxRequestTarget
button
- theDialogButton
that submitted the form
-
onError
protected final 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 classAbstractFormDialog<T extends Serializable>
- Parameters:
target
- theAjaxRequestTarget
button
- theDialogButton
that submitted the form
-
onFinish
public void onFinish()
- Specified by:
onFinish
in interfaceorg.apache.wicket.extensions.wizard.IWizardModelListener
-
onCancel
public void onCancel()
- Specified by:
onCancel
in interfaceorg.apache.wicket.extensions.wizard.IWizardModelListener
-
onFinish
protected abstract void onFinish(org.apache.wicket.ajax.AjaxRequestTarget target)
Triggered when the wizard completes- Parameters:
target
- theAjaxRequestTarget
-
onCancel
protected void onCancel(org.apache.wicket.ajax.AjaxRequestTarget target)
Triggered when the wizard has been canceled- Parameters:
target
- theAjaxRequestTarget
-
getWizardModel
public org.apache.wicket.extensions.wizard.IWizardModel getWizardModel()
- Specified by:
getWizardModel
in interfaceorg.apache.wicket.extensions.wizard.IWizard
-
onActiveStepChanged
public void onActiveStepChanged(org.apache.wicket.extensions.wizard.IWizardStep step)
- Specified by:
onActiveStepChanged
in interfaceorg.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 classAbstractDialog<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 byAbstractDialog.getButtons()
- Specified by:
getSubmitButton
in classAbstractFormDialog<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 classAbstractFormDialog<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 classAbstractFormDialog<T extends Serializable>
- Parameters:
button
- the dialog's button- Returns:
- the
Form
ornull
-
newFeedbackPanel
protected org.apache.wicket.markup.html.WebMarkupContainer newFeedbackPanel(String id)
Gets a newFeedbackPanel
- Parameters:
id
- the markup id- Returns:
- a new
JQueryFeedbackPanel
by default
-
-