org.apache.tapestry.form
Class PropertySelection

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.form.AbstractFormComponent
              extended by org.apache.tapestry.form.AbstractRequirableField
                  extended by org.apache.tapestry.form.PropertySelection
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, IFormComponent, RequirableField, IComponent, IRender

public abstract class PropertySelection
extends AbstractRequirableField

A component used to render a drop-down list of options that the user may select. [ Component Reference ]

Earlier versions of PropertySelection (through release 2.2) were more flexible, they included a renderer property that controlled how the selection was rendered. Ultimately, this proved of little value and this portion of functionality was deprecated in 2.3 and will be removed in 2.3.

Typically, the values available to be selected are defined using an org.apache.commons.lang.enum.Enum. A PropertySelection is dependent on an IPropertySelectionModel to provide the list of possible values.

Often, this is used to select a particular org.apache.commons.lang.enum.Enum to assign to a property; the EnumPropertySelectionModel class simplifies this. As of 4.0, PropertySelection can indicate that it is required. Often, a drop-down list will contain an initial option that serves both as a label and to represent that nothing is selected. This can behavior can easily be achieved by decorating an existing IPropertySelectionModel with a LabeledPropertySelectionModel.

Author:
Howard Lewis Ship, Paul Ferraro

Constructor Summary
PropertySelection()
           
 
Method Summary
 void bind(IMarkupWriter writer, IRequestCycle cycle)
          Called on the field if the required field check succeeds.
protected  void finishLoad()
          Invoked, as a convienience, from AbstractComponent.finishLoad(IRequestCycle, IPageLoader, IComponentSpecification).
abstract  IPropertySelectionModel getModel()
           
abstract  boolean getSubmitOnChange()
           
abstract  java.lang.Object getValue()
           
protected  void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)
          Renders the component.
abstract  void setValue(java.lang.Object value)
           
 
Methods inherited from class org.apache.tapestry.form.AbstractRequirableField
getRequirableFieldSupport, getSubmittedValue, rewindFormComponent, setRequiredMessage
 
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent
getForm, getIdParameter, getName, renderComponent, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, renderIdAttribute, select, setClientId, setForm, setName, setName
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainer, setId, setNamespace, setPage, setProperty, toString
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.form.RequirableField
getRequiredMessage, isRequired
 
Methods inherited from interface org.apache.tapestry.form.IFormComponent
getClientId, getDisplayName, getForm, getName, isDisabled, setName
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainer, setId, setNamespace, setPage, setProperty
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

PropertySelection

public PropertySelection()
Method Detail

bind

public void bind(IMarkupWriter writer,
                 IRequestCycle cycle)
          throws ValidatorException
Description copied from interface: RequirableField
Called on the field if the required field check succeeds.

Throws:
ValidatorException - if required field check fails.
See Also:
org.apache.tapestry.form.validator.AbstractRequirableField#bind(org.apache.tapestry.IRequestCycle, java.lang.String)

finishLoad

protected void finishLoad()
Description copied from class: AbstractComponent
Invoked, as a convienience, from AbstractComponent.finishLoad(IRequestCycle, IPageLoader, IComponentSpecification). This implemenation does nothing. Subclasses may override without invoking this implementation.

Overrides:
finishLoad in class AbstractComponent
See Also:
AbstractComponent.finishLoad()

renderFormComponent

protected void renderFormComponent(IMarkupWriter writer,
                                   IRequestCycle cycle)
Renders the component. The possible options, their labels, and the values to be encoded in the form are provided by the model.

Overrides:
renderFormComponent in class AbstractRequirableField
See Also:
org.apache.tapestry.form.validator.AbstractRequirableField#renderRequirableFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)

getModel

public abstract IPropertySelectionModel getModel()

getSubmitOnChange

public abstract boolean getSubmitOnChange()
Since:
2.2 *

getValue

public abstract java.lang.Object getValue()
Since:
2.2 *

setValue

public abstract void setValue(java.lang.Object value)
Since:
2.2 *