Class WizardStep
- 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.extensions.wizard.WizardStep
-
- All Implemented Interfaces:
Serializable,Iterable<org.apache.wicket.Component>,org.apache.wicket.event.IEventSink,org.apache.wicket.event.IEventSource,IWizardStep,org.apache.wicket.feedback.IFeedbackContributor,org.apache.wicket.IConverterLocator,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
- Direct Known Subclasses:
DynamicWizardStep,StaticContentStep
public class WizardStep extends org.apache.wicket.markup.html.panel.Panel implements IWizardStep
default implementation ofIWizardStep. It is also a panel, which is used as the view component.And example of a custom step with a panel follows. Java (defined e.g. in class x.NewUserWizard):
private final class UserNameStep extends WizardStep { public UserNameStep() { super(new ResourceModel("username.title"), new ResourceModel("username.summary")); add(new RequiredTextField("user.userName")); add(new RequiredTextField("user.email").add(EmailAddressValidator.getInstance())); } }HTML (defined in e.g. file x/NewUserWizard$UserNameStep.html):<wicket:panel> <table> <tr> <td><wicket:message key="username">Username</wicket:message></td> <td><input type="text" wicket:id="user.userName" /></td> </tr> <tr> <td><wicket:message key="email">Email Address</wicket:message></td> <td><input type="text" wicket:id="user.email" /></td> </tr> </table> </wicket:panel>- Author:
- Eelco Hillenius
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WizardStep()Construct without a title and a summary.WizardStep(String title, String summary)Creates a new step with the specified title and summary.WizardStep(String title, String summary, org.apache.wicket.model.IModel<?> model)Creates a new step with the specified title and summary.WizardStep(org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<String> summary)Creates a new step with the specified title and summary.WizardStep(org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<String> summary, org.apache.wicket.model.IModel<?> model)Creates a new step with the specified title and summary.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(org.apache.wicket.markup.html.form.validation.IFormValidator validator)Adds a form validator.voidapplyState()This method is called whenever the wizard proceeds from this step to another step.protected voiddetachModel()org.apache.wicket.ComponentgetHeader(String id, org.apache.wicket.Component parent, IWizard wizard)Gets the header component for this step.StringgetSummary()Gets the summary of this step.StringgetTitle()Gets the title of this step.org.apache.wicket.ComponentgetView(String id, org.apache.wicket.Component parent, IWizard wizard)Returns the current view this step is displaying.IWizardModelgetWizardModel()voidinit(IWizardModel wizardModel)Called to initialize the step.booleanisComplete()Checks if this step is compete.protected voidonInit(IWizardModel wizardModel)Template method that is called when the step is being initialized.protected voidonInitialize()voidsetComplete(boolean complete)Marks this step as compete.voidsetSummaryModel(org.apache.wicket.model.IModel<String> summary)Sets summary.voidsetTitleModel(org.apache.wicket.model.IModel<String> title)Sets title.-
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, onDetach, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, 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, 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, getModelComparator, 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, onModelChanged, 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 java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
WizardStep
public WizardStep()
Construct without a title and a summary. Useful for when you provide a custom header by overidinggetHeader(String, Component, IWizard).
-
WizardStep
public WizardStep(org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<String> summary)
Creates a new step with the specified title and summary. The title and summary are displayed in the wizard title block while this step is active.- Parameters:
title- the title of this step.summary- a brief summary of this step or some usage guidelines.
-
WizardStep
public WizardStep(org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<String> summary, org.apache.wicket.model.IModel<?> model)
Creates a new step with the specified title and summary. The title and summary are displayed in the wizard title block while this step is active.- Parameters:
title- the title of this step.summary- a brief summary of this step or some usage guidelines.model- Any model which is to be used for this step
-
WizardStep
public WizardStep(String title, String summary)
Creates a new step with the specified title and summary. The title and summary are displayed in the wizard title block while this step is active.- Parameters:
title- the title of this step.summary- a brief summary of this step or some usage guidelines.
-
WizardStep
public WizardStep(String title, String summary, org.apache.wicket.model.IModel<?> model)
Creates a new step with the specified title and summary. The title and summary are displayed in the wizard title block while this step is active.- Parameters:
title- the title of this step.summary- a brief summary of this step or some usage guidelines.model- Any model which is to be used for this step
-
-
Method Detail
-
add
public final void add(org.apache.wicket.markup.html.form.validation.IFormValidator validator)
Adds a form validator.- Parameters:
validator-
-
applyState
public void applyState()
Description copied from interface:IWizardStepThis method is called whenever the wizard proceeds from this step to another step. It is not called when returning to a previous step.- Specified by:
applyStatein interfaceIWizardStep- See Also:
IWizardStep.applyState()
-
getHeader
public org.apache.wicket.Component getHeader(String id, org.apache.wicket.Component parent, IWizard wizard)
Description copied from interface:IWizardStepGets the header component for this step. This component is displayed in a special section of the wizard.This method is called every time this step becomes the active step of the wizard.
- Specified by:
getHeaderin interfaceIWizardStep- Parameters:
id- The id that the component should be created withparent- The parent component (for post 1.2)wizard- The wizard component the header will be placed on- Returns:
- The header component
- See Also:
IWizardStep.getHeader(java.lang.String, org.apache.wicket.Component, org.apache.wicket.extensions.wizard.IWizard)
-
getSummary
public String getSummary()
Gets the summary of this step. This will be displayed in the title of the wizard while this step is active. The summary is typically an overview of the step or some usage guidelines for the user.- Returns:
- the summary of this step.
-
getView
public org.apache.wicket.Component getView(String id, org.apache.wicket.Component parent, IWizard wizard)
Description copied from interface:IWizardStepReturns the current view this step is displaying. This component will be displayed in the main section of the wizard.This method is called every time this step becomes the active step of the wizard.
- Specified by:
getViewin interfaceIWizardStep- Parameters:
id- The id that the component should be created withparent- The parent component (for post 1.2)wizard- The wizard component the header will be placed on- Returns:
- The current view of the step.
- See Also:
IWizardStep.getView(java.lang.String, org.apache.wicket.Component, org.apache.wicket.extensions.wizard.IWizard)
-
init
public final void init(IWizardModel wizardModel)
Called to initialize the step. When this method is called depends on the kind of wizard model that is used. Thestatic wizard modelknows all the steps upfront and initializes themm when starting up. This method will be called when the wizard isinitializing. Thedynamic wizard modelinitializes steps every time they are encountered. This method sets the wizard model and then calls template methodonInit(IWizardModel)- Specified by:
initin interfaceIWizardStep- Parameters:
wizardModel- the model to which the step belongs.
-
isComplete
public boolean isComplete()
Checks if this step is compete. This method should return true if the wizard can proceed to the next step. This property is bound and changes can be made at anytime by callingsetComplete(boolean).- Specified by:
isCompletein interfaceIWizardStep- Returns:
- true if the wizard can proceed from this step, false otherwise.
- See Also:
setComplete(boolean)
-
setComplete
public void setComplete(boolean complete)
Marks this step as compete. The wizard will not be able to proceed from this step until this property is configured to true.- Parameters:
complete- true to allow the wizard to proceed, false otherwise.- See Also:
isComplete()
-
setSummaryModel
public void setSummaryModel(org.apache.wicket.model.IModel<String> summary)
Sets summary.- Parameters:
summary- summary
-
setTitleModel
public void setTitleModel(org.apache.wicket.model.IModel<String> title)
Sets title.- Parameters:
title- title
-
detachModel
protected void detachModel()
- Overrides:
detachModelin classorg.apache.wicket.Component- See Also:
Component.detachModel()
-
onInitialize
protected void onInitialize()
- Overrides:
onInitializein classorg.apache.wicket.MarkupContainer
-
onInit
protected void onInit(IWizardModel wizardModel)
Template method that is called when the step is being initialized.- Parameters:
wizardModel-- See Also:
init(IWizardModel)
-
getWizardModel
public IWizardModel getWizardModel()
- Returns:
- wizard model
-
-