wicket.extensions.wizard
Class WizardStep

java.lang.Object
  extended by wicket.Component
      extended by wicket.MarkupContainer
          extended by wicket.markup.html.WebMarkupContainer
              extended by wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
                  extended by wicket.markup.html.panel.Panel
                      extended by wicket.extensions.wizard.WizardStep
All Implemented Interfaces:
java.io.Serializable, IWizardStep
Direct Known Subclasses:
StaticContentStep

public class WizardStep
extends wicket.markup.html.panel.Panel
implements IWizardStep

default implementation of 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(EmailAddressPatternValidator.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 Adress</wicket:message></td>
                           <td><input type="text" wicket:id="user.email" /></td>
                          </tr>
                         </table>
                        </wicket:panel>
 

Author:
Eelco Hillenius
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.HeaderPartContainer
 
Nested classes/interfaces inherited from class wicket.Component
wicket.Component.ComponentModelChange, wicket.Component.EnabledChange, wicket.Component.IVisitor, wicket.Component.VisibilityChange
 
Field Summary
 
Fields inherited from class wicket.Component
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER
 
Constructor Summary
WizardStep()
          Construct without a title and a summary.
WizardStep(wicket.model.IModel title, wicket.model.IModel summary)
          Creates a new step with the specified title and summary.
WizardStep(wicket.model.IModel title, wicket.model.IModel summary, wicket.model.IModel model)
          Creates a new step with the specified title and summary.
WizardStep(java.lang.String title, java.lang.String summary)
          Creates a new step with the specified title and summary.
WizardStep(java.lang.String title, java.lang.String summary, wicket.model.IModel model)
          Creates a new step with the specified title and summary.
 
Method Summary
 void add(wicket.markup.html.form.validation.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()
           
 wicket.Component getHeader(java.lang.String id, wicket.Component parent, IWizard wizard)
          Gets the header component for this step.
 java.lang.String getSummary()
          Gets the summary of this step.
 java.lang.String getTitle()
          Gets the title of this step.
 wicket.Component getView(java.lang.String id, wicket.Component parent, IWizard wizard)
          Returns the current view this step is displaying.
 void init(IWizardModel wizardModel)
          Called to initialize the step.
 boolean isComplete()
          Checks if this step is compete.
protected  void onAttach()
          Workaround for adding the form validators; not needed in 2.0.
protected  void onInit(IWizardModel wizardModel)
          Called when the step is being initialized.
 void setComplete(boolean complete)
          Marks this step as compete.
 void setSummaryModel(wicket.model.IModel summary)
          Sets summary.
 void setTitleModel(wicket.model.IModel title)
          Sets title.
 
Methods inherited from class wicket.markup.html.panel.Panel
onComponentTag, onComponentTagBody, renderHead
 
Methods inherited from class wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
newHeaderPartContainer, renderHeadFromAssociatedMarkupFile
 
Methods inherited from class wicket.markup.html.WebMarkupContainer
getMarkupType, getWebPage
 
Methods inherited from class wicket.MarkupContainer
add, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, internalAdd, internalAttach, internalDetach, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren
 
Methods inherited from class wicket.Component
add, addStateChange, checkComponentTag, checkComponentTagAttribute, continueToOriginalDestination, debug, detachBehaviors, detachModels, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getApplicationPages, getApplicationSettings, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMetaData, getModel, getModelComparator, getModelObject, getModelObjectAsString, getOutputMarkupId, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isBehaviorAccepted, isEnableAllowed, isEnabled, isHeadRendered, isIgnoreAttributeModifier, isRenderAllowed, isVersioned, isVisible, isVisibleInHierarchy, modelChanged, modelChanging, newPage, newPage, onAfterRender, onBeforeRender, onBeginRequest, onDetach, onEndRequest, onModelChanged, onModelChanging, onRender, redirectToInterceptPage, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderedBehaviors, replaceComponentTagBody, replaceWith, resetHeadRendered, sameRootModel, sameRootModel, setAuto, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMetaData, setModelObject, setOutputMarkupId, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WizardStep

public WizardStep()
Construct without a title and a summary. Useful for when you provide a custom header by overiding #getHeader(String, Component, Wizard).


WizardStep

public WizardStep(wicket.model.IModel title,
                  wicket.model.IModel 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(wicket.model.IModel title,
                  wicket.model.IModel summary,
                  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(java.lang.String title,
                  java.lang.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(java.lang.String title,
                  java.lang.String summary,
                  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

detachModel

protected void detachModel()
Overrides:
detachModel in class wicket.Component
See Also:
Component.detachModel()

add

public final void add(wicket.markup.html.form.validation.IFormValidator validator)
Adds a form validator.

Parameters:
validator -

applyState

public void applyState()
Description copied from interface: IWizardStep
This method is called whenever the user presses next while this step is active.

This method will only be called if IWizardModel.isNextAvailable() and IWizardStep.isComplete() return true.

Specified by:
applyState in interface IWizardStep
See Also:
IWizardStep.applyState()

getHeader

public wicket.Component getHeader(java.lang.String id,
                                  wicket.Component parent,
                                  IWizard wizard)
Description copied from interface: IWizardStep
Gets the header component for this step. This component is displayed in a special section of the wizard.

Specified by:
getHeader in interface IWizardStep
Parameters:
id - The id that the component should be created with
parent - The parent component (for post 1.2)
wizard - The wizard component the header will be placed on
Returns:
The header component
See Also:
wicket.extensions.wizard.IWizardStep#getHeader(java.lang.String, wicket.Component, wicket.extensions.wizard.Wizard)

getSummary

public java.lang.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.

getTitle

public java.lang.String getTitle()
Gets the title of this step.

Returns:
the title of this step.

getView

public wicket.Component getView(java.lang.String id,
                                wicket.Component parent,
                                IWizard wizard)
Description copied from interface: IWizardStep
Returns the current view this step is displaying. This component will be displayed in the main section of the wizard with this step is active. This may changed at any time by as long as an appropriate property change event is fired.

Specified by:
getView in interface IWizardStep
Parameters:
id - The id that the component should be created with
parent - 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:
wicket.extensions.wizard.IWizardStep#getView(java.lang.String, wicket.Component, wicket.extensions.wizard.Wizard)

init

public final void init(IWizardModel wizardModel)
Called to initialize the step. This method will be called when the wizard is first initialising. This method sets the wizard model and then calls template method onInit(IWizardModel)

Specified by:
init in interface IWizardStep
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 calling setComplete(boolean) .

Specified by:
isComplete in interface IWizardStep
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(wicket.model.IModel summary)
Sets summary.

Parameters:
summary - summary

setTitleModel

public void setTitleModel(wicket.model.IModel title)
Sets title.

Parameters:
title - title

onAttach

protected void onAttach()
Workaround for adding the form validators; not needed in 2.0.

Overrides:
onAttach in class wicket.Component
See Also:
Component.onAttach()

onInit

protected void onInit(IWizardModel wizardModel)
Called when the step is being initialized.

Parameters:
wizardModel -


Copyright © 2004-2008 Wicket developers. All Rights Reserved.