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 booleancloseOnCancel()Indicates whether the wizard should close whenonCancel()is triggeredprotected booleancloseOnFinish()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 DialogButtongetCancelButton()Gets the button that is in charge to cancel to wizard.org.apache.wicket.markup.html.WebMarkupContainergetFeedbackPanel()Gets the wizardFeedbackPanelorg.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.DialogButtongetSubmitButton()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.IWizardModelgetWizardModel()protected voidinit(org.apache.wicket.extensions.wizard.IWizardModel wizardModel)Initializationprotected org.apache.wicket.markup.html.WebMarkupContainernewFeedbackPanel(String id)Gets a newFeedbackPanelvoidonActiveStepChanged(org.apache.wicket.extensions.wizard.IWizardStep step)voidonCancel()protected voidonCancel(org.apache.wicket.ajax.AjaxRequestTarget target)Triggered when the wizard has been canceledvoidonClick(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)Triggered when a wizard button is clicked.voidonConfigure(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
Warning:autoOpenoption is not supportedprotected voidonConfigure(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)Called when the wizard needs to be configured.protected voidonError(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)Triggered when the form is submitted, but the validation failedvoidonFinish()protected abstract voidonFinish(org.apache.wicket.ajax.AjaxRequestTarget target)Triggered when the wizard completesprotected voidonInitialize()protected voidonOpen(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)Triggered when the dialog opensprotected voidonSubmit(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)Triggered when the form is submitted, and the validation succeedprotected voidreload(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.-
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, 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, 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 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
-
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:
trueby default
-
closeOnFinish
protected boolean closeOnFinish()
Indicates whether the wizard should close whenonFinish()is triggered- Returns:
trueby default
-
onInitialize
protected void onInitialize()
- Overrides:
onInitializein classAbstractFormDialog<T extends Serializable>
-
onConfigure
public void onConfigure(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
Warning:autoOpenoption is not supported- Specified by:
onConfigurein interfacecom.googlecode.wicket.jquery.core.IJQueryWidget- Overrides:
onConfigurein 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:AbstractDialogTriggered when the dialog opens- Overrides:
onOpenin 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:
onClickin interfaceIDialogListener- Overrides:
onClickin classAbstractDialog<T extends Serializable>- Parameters:
target- theAjaxRequestTargetbutton- the button that closed the dialog
-
onSubmit
protected void onSubmit(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)Description copied from class:AbstractFormDialogTriggered when the form is submitted, and the validation succeed- Specified by:
onSubmitin classAbstractFormDialog<T extends Serializable>- Parameters:
target- theAjaxRequestTargetbutton- theDialogButtonthat submitted the form
-
onError
protected final void onError(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)Description copied from class:AbstractFormDialogTriggered when the form is submitted, but the validation failed- Specified by:
onErrorin classAbstractFormDialog<T extends Serializable>- Parameters:
target- theAjaxRequestTargetbutton- theDialogButtonthat submitted the form
-
onFinish
public void onFinish()
- Specified by:
onFinishin interfaceorg.apache.wicket.extensions.wizard.IWizardModelListener
-
onCancel
public void onCancel()
- Specified by:
onCancelin 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:
getWizardModelin interfaceorg.apache.wicket.extensions.wizard.IWizard
-
onActiveStepChanged
public void onActiveStepChanged(org.apache.wicket.extensions.wizard.IWizardStep step)
- Specified by:
onActiveStepChangedin interfaceorg.apache.wicket.extensions.wizard.IWizardModelListener
-
getButtons
protected List<DialogButton> getButtons()
Description copied from class:AbstractDialogGets 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:
getButtonsin classAbstractDialog<T extends Serializable>- Returns:
AbstractDialog.btnOkby default
-
getSubmitButton
public DialogButton getSubmitButton()
Description copied from class:AbstractFormDialogGets the button that is in charge to submit the form.
It should be in the list of buttons returned byAbstractDialog.getButtons()- Specified by:
getSubmitButtonin 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:AbstractFormDialogGets 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:
getFormin 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:
getFormin classAbstractFormDialog<T extends Serializable>- Parameters:
button- the dialog's button- Returns:
- the
Formornull
-
newFeedbackPanel
protected org.apache.wicket.markup.html.WebMarkupContainer newFeedbackPanel(String id)
Gets a newFeedbackPanel- Parameters:
id- the markup id- Returns:
- a new
JQueryFeedbackPanelby default
-
-