com.arsdigita.bebop
Class FormStep

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.FormSection
              extended bycom.arsdigita.bebop.FormStep
All Implemented Interfaces:
Cloneable, Component, Container, Lockable
Direct Known Subclasses:
MultipleSelectPairWidget

public class FormStep
extends FormSection

The FormStep class modifies the behavior of FormSection with respect to listener firing. Instead of firing init listeners the first time the enclosing form is displayed on the page, the FormStep class fires init listeners the first time the FormStep itself is displayed on the page. The process, validate, and submission listeners are then fired on every submission following the one in which the init listeners were fired. This behavior is useful when used in conjunction with MultiStepForm or its subclasses to provide initialization in later steps of a multi step form that depends on the values entered in earlier steps.

Version:
$Revision: #8 $ $Date: 2004/04/07 $
Author:
rhs@mit.edu
See Also:
Wizard, MultiStepForm

Field Summary
static String versionId
           
 
Fields inherited from class com.arsdigita.bebop.FormSection
m_formModel, m_panel
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
  FormStep(String name)
          Constructs a new FormStep with the given name.
  FormStep(String name, Container panel)
          Constructs a new FormStep with the given name.
protected FormStep(String name, Container panel, FormModel model)
           
 
Method Summary
protected  FormInitListener createInitListener()
          Creates the init listener that forwards init events to this form section.
protected  void fireProcess(FormSectionEvent evt)
          Calls the process method on all registered process listeners.
protected  void fireSubmitted(FormSectionEvent evt)
          Calls the submitted method on all registered submission listeners.
protected  void fireValidate(FormSectionEvent evt)
          Calls the validate method on all registered validation listeners.
 void generateXML(PageState ps, Element parent)
          Builds an XML subtree for this component under the specified parent.
 boolean isInitialized(PageState ps)
           
 void register(Form form, FormModel model)
          Traverses the children this FormSection, collecting parameter models and listeners into the supplied FormModel.
 void register(Page p)
          Registers state parameters for the page with its model.
 
Methods inherited from class com.arsdigita.bebop.FormSection
add, add, addCancelListener, addInitListener, addProcessListener, addSubmissionListener, addValidationListener, children, contains, createProcessListener, createSubmissionListener, createValidationListener, fireCancel, fireInit, forwardInit, forwardProcess, forwardSubmission, forwardValidation, get, getModel, getPanel, indexOf, isEmpty, lock, process, removeCancelListener, removeInitListener, removeProcessListener, removeSubmissionListener, removeValidationListener, respond, size
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arsdigita.bebop.Component
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

FormStep

public FormStep(String name)
Constructs a new FormStep with the given name. The name must uniquely identify this FormStep within it's enclosing Form.

Parameters:
name - A name that uniquely identifies this FormStep within it's enclosing Form.

FormStep

public FormStep(String name,
                Container panel)
Constructs a new FormStep with the given name. The name must uniquely identify this FormStep within it's enclosing Form.

Parameters:
name - A name that uniquely identifies this FormStep within it's enclosing Form.
panel - The container used to back this FormStep.

FormStep

protected FormStep(String name,
                   Container panel,
                   FormModel model)
Method Detail

register

public void register(Page p)
Description copied from interface: Component
Registers state parameters for the page with its model. A simple component with a state parameter param would do the following in the body of this method:
   p.addComponent(this);
   p.addComponentStateParam(this, param);
 
You should override this method to set the default visibility of your component:
 public void register(Page p) {
     super.register(p);
     p.setVisibleDefault(childNotInitiallyShown,false);
     p.setVisibleDefault(anotherChild, false);
 }
 
Always call super.register when you override register. Otherwise your component may malfunction and produce errors like "Widget ... isn't associated with any Form"

Specified by:
register in interface Component
Overrides:
register in class SimpleComponent

register

public void register(Form form,
                     FormModel model)
Description copied from class: FormSection
Traverses the children this FormSection, collecting parameter models and listeners into the supplied FormModel. Sets implicit pointers of widgets in this FormSection to the supplied Form.

Specified by:
register in interface Component
Overrides:
register in class FormSection
Parameters:
form - pointer to the form that is set inside Widgets within this FormSection
model - the FormModel in which to merge ParameterModels and Listeners

isInitialized

public boolean isInitialized(PageState ps)

createInitListener

protected FormInitListener createInitListener()
Description copied from class: FormSection
Creates the init listener that forwards init events to this form section.

Overrides:
createInitListener in class FormSection
Returns:
an init listener that forwards init events to this form section.

fireSubmitted

protected void fireSubmitted(FormSectionEvent evt)
                      throws FormProcessException
Description copied from class: FormSection
Calls the submitted method on all registered submission listeners.

Overrides:
fireSubmitted in class FormSection
Parameters:
evt - the event to pass to the listeners
Throws:
FormProcessException - if one of the listeners throws such an exception.

fireValidate

protected void fireValidate(FormSectionEvent evt)
Description copied from class: FormSection
Calls the validate method on all registered validation listeners.

Overrides:
fireValidate in class FormSection
Parameters:
evt - the event to pass to the listeners

fireProcess

protected void fireProcess(FormSectionEvent evt)
                    throws FormProcessException
Description copied from class: FormSection
Calls the process method on all registered process listeners.

Overrides:
fireProcess in class FormSection
Parameters:
evt - the event to pass to the listeners
Throws:
FormProcessException - if one of the listeners throws such an exception.

generateXML

public void generateXML(PageState ps,
                        Element parent)
Description copied from class: FormSection
Builds an XML subtree for this component under the specified parent. Uses the request values stored in state.

This method generates DOM to be used with the XSLT template to produce the appropriate output.

Specified by:
generateXML in interface Component
Overrides:
generateXML in class FormSection
Parameters:
ps - the state of the current page
parent - the node that will be used to write to


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC