public class WizardStep extends Panel implements IWizardStep
IWizardStep
. 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>
ENABLE, FLAG_AFTER_RENDERING, FLAG_INITIALIZED, FLAG_PREPARED_FOR_RENDER, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RENDERING, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING
Constructor and Description |
---|
WizardStep()
Construct without a title and a summary.
|
WizardStep(IModel<String> title,
IModel<String> summary)
Creates a new step with the specified title and summary.
|
WizardStep(IModel<String> title,
IModel<String> summary,
IModel<?> model)
Creates a new step with the specified title and summary.
|
WizardStep(String title,
String summary)
Creates a new step with the specified title and summary.
|
WizardStep(String title,
String summary,
IModel<?> model)
Creates a new step with the specified title and summary.
|
Modifier and Type | Method and Description |
---|---|
void |
add(IFormValidator validator)
Adds a form validator.
|
void |
applyState()
This method is called whenever the user presses next while this step is active.
|
protected void |
detachModel()
Detaches the model for this component if it is detachable.
|
Component |
getHeader(String id,
Component parent,
IWizard wizard)
Gets the header component for this step.
|
String |
getSummary()
Gets the summary of this step.
|
String |
getTitle()
Gets the title of this step.
|
Component |
getView(String id,
Component parent,
IWizard wizard)
Returns the current view this step is displaying.
|
IWizardModel |
getWizardModel() |
void |
init(IWizardModel wizardModel)
Called to initialize the step.
|
boolean |
isComplete()
Checks if this step is compete.
|
protected void |
onInit(IWizardModel wizardModel)
Template method that is called when the step is being initialized.
|
protected void |
onInitialize()
This method is meant to be used as an alternative to initialize components.
|
void |
setComplete(boolean complete)
Marks this step as compete.
|
void |
setSummaryModel(IModel<String> summary)
Sets summary.
|
void |
setTitleModel(IModel<String> title)
Sets title.
|
getRegionMarkup, newMarkupSourcingStrategy
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onComponentTagBody, onDetach, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, 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, 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, internalPrepareForRender, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dequeue, newDequeueContext
public WizardStep()
getHeader(String, Component, IWizard)
.public WizardStep(IModel<String> title, IModel<String> summary)
title
- the title of this step.summary
- a brief summary of this step or some usage guidelines.public WizardStep(IModel<String> title, IModel<String> summary, IModel<?> model)
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 steppublic WizardStep(String title, String summary)
title
- the title of this step.summary
- a brief summary of this step or some usage guidelines.public WizardStep(String title, String summary, IModel<?> model)
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 steppublic final void add(IFormValidator validator)
validator
- public void applyState()
IWizardStep
This method will only be called if IWizardModel.isNextAvailable()
returns true
.
applyState
in interface IWizardStep
IWizardStep.applyState()
public Component getHeader(String id, Component parent, IWizard wizard)
IWizardStep
getHeader
in interface IWizardStep
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 onIWizardStep.getHeader(java.lang.String,
org.apache.wicket.Component, org.apache.wicket.extensions.wizard.IWizard)
public String getSummary()
public String getTitle()
public Component getView(String id, Component parent, IWizard wizard)
IWizardStep
getView
in interface IWizardStep
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 onIWizardStep.getView(java.lang.String,
org.apache.wicket.Component, org.apache.wicket.extensions.wizard.IWizard)
public final void init(IWizardModel wizardModel)
static wizard model
knows all the steps upfront and initializes themm
when starting up. This method will be called when the wizard is initializing
.
The dynamic wizard model
initializes steps every time they are
encountered.
This method sets the wizard model and then calls template method
onInit(IWizardModel)
init
in interface IWizardStep
wizardModel
- the model to which the step belongs.public boolean isComplete()
setComplete(boolean)
.isComplete
in interface IWizardStep
setComplete(boolean)
public void setComplete(boolean complete)
complete
- true to allow the wizard to proceed, false otherwise.isComplete()
public void setSummaryModel(IModel<String> summary)
summary
- summaryprotected void detachModel()
Component
detachModel
in class Component
Component.detachModel()
protected void onInitialize()
Component
Page
thus providing the component with an atomic callback
when the component's environment is built out.
Overrides must call super#Component.onInitialize()
. Usually this should be the first thing an
override does, much like a constructor.
Parent containers are guaranteed to be initialized before their children
It is safe to use Component.getPage()
in this method
NOTE:The timing of this call is not precise, the contract is that it is called sometime
before Component.onBeforeRender()
.
onInitialize
in class MarkupContainer
protected void onInit(IWizardModel wizardModel)
wizardModel
- init(IWizardModel)
public IWizardModel getWizardModel()
Copyright © 2006–2021 Apache Software Foundation. All rights reserved.