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:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog
AbstractFormDialog.DialogFormSubmitterNested 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, YESFields inherited from class org.apache.wicket.markup.html.panel.Panel
PANELFields 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
ConstructorsConstructorDescriptionAbstractWizard(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
Modifier and TypeMethodDescriptionprotected booleanIndicates whether the wizard should close whenonCancel()is triggeredprotected booleanIndicates whether the wizard should close whenonFinish()is triggeredprotected 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 DialogButtonGets the button that is in charge to cancel to wizard.org.apache.wicket.markup.html.WebMarkupContainerGets 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.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.IWizardModelprotected final voidinit(org.apache.wicket.extensions.wizard.IWizardModel wizardModel) Initializationprotected org.apache.wicket.markup.html.WebMarkupContainerGets a newFeedbackPanelprotected org.apache.wicket.markup.html.form.Form<T>Gets a newForm
Caution: this method is called by ctors having theIWizardModelargumentvoidonActiveStepChanged(org.apache.wicket.extensions.wizard.IWizardStep step) voidonCancel()protected voidonCancel(org.apache.wicket.ajax.AjaxRequestTarget target) Triggered when the wizard has been canceledfinal voidonClick(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 voidprotected 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.voidrenderHead(org.apache.wicket.markup.head.IHeaderResponse response) Methods inherited from class com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog
getDefaultFormProcessing, getModelComparator, newButtonAjaxBehavior, onClose, onModelChangedMethods 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, setTitleMethods inherited from class org.apache.wicket.markup.html.panel.Panel
getRegionMarkup, newMarkupSourcingStrategyMethods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSessionMethods 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, visitChildrenMethods 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, wrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.wicket.IGenericComponent
getDefaultModel, getDefaultModelObject, getModel, getModelObject, setDefaultModel, setDefaultModelObject, setModel, setModelObjectMethods inherited from interface org.apache.wicket.IQueueRegion
dequeue, newDequeueContextMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
AbstractWizard
Constructor- Parameters:
id- the markup idtitle- the dialog's title
-
AbstractWizard
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
Constructor- Parameters:
id- the markup idtitle- the dialog's titlemodal- indicates whether the dialog is modal
-
AbstractWizard
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
Constructor- Parameters:
id- the markup idtitle- the dialog's titlemodel- 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 idtitle- the dialog's titlemodel- the dialog's model
-
-
Method Details
-
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:
renderHeadin interfaceorg.apache.wicket.markup.html.IHeaderContributor- Overrides:
renderHeadin 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:
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
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
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
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
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
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
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
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
-
newForm
Gets a newForm
Caution: this method is called by ctors having theIWizardModelargument- Parameters:
formId- the form id- Returns:
- the form
-
newFeedbackPanel
Gets a newFeedbackPanel- Parameters:
id- the markup id- Returns:
- a new
JQueryFeedbackPanelby default
-