org.apache.tapestry.form
Class PropertySelection
java.lang.Object
org.apache.hivemind.impl.BaseLocatable
org.apache.tapestry.AbstractComponent
org.apache.tapestry.form.AbstractFormComponent
org.apache.tapestry.form.PropertySelection
- All Implemented Interfaces:
- org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, IFormComponent, ValidatableField, IComponent, IDirectEvent, Component, IRender
public abstract class PropertySelection
- extends AbstractFormComponent
- implements ValidatableField
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
Enum
. A PropertySelection is dependent on an
IPropertySelectionModel
to provide the list of possible values.
Often, this is used to select a particular Enum
to assign to
a property; the EnumPropertySelectionModel
class simplifies this.
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
.
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent |
generateClientId, getCanTakeFocus, getForm, getIdParameter, getName, getRenderBodyOnRewind, peekClientId, renderComponent, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, setForm, setName, setName |
Methods inherited from class org.apache.tapestry.AbstractComponent |
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, equals, finishLoad, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getBoundId, getClientId, getComponent, getComponents, getContainedComponent, getContainedRenderers, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getInnerRenderers, getListeners, getMessages, getNamespace, getPage, getRenderWorker, getSpecification, getSpecifiedId, getTemplateTagName, hasEvents, hashCode, isInActiveState, isParameterBound, isRendering, isStateful, pageEndRender, prepareForRender, render, renderBody, renderIdAttribute, renderInformalParameters, setBinding, setClientId, setContainedComponent, setContainer, setHasEvents, setId, setNamespace, setPage, setTemplateTagName, toString, triggerEvent |
Methods inherited from class org.apache.hivemind.impl.BaseLocatable |
getLocation, setLocation |
Methods inherited from interface org.apache.tapestry.IComponent |
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName |
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 |
PropertySelection
public PropertySelection()
renderFormComponent
protected void renderFormComponent(IMarkupWriter writer,
IRequestCycle cycle)
- Description copied from class:
AbstractFormComponent
- Invoked from
AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle)
to render the component.
- Specified by:
renderFormComponent
in class AbstractFormComponent
- See Also:
AbstractFormComponent.renderFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)
rewindFormComponent
protected void rewindFormComponent(IMarkupWriter writer,
IRequestCycle cycle)
- Description copied from class:
AbstractFormComponent
- Invoked from
AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle)
to rewind the
component. If the component is disabled
this will not be invoked.
- Specified by:
rewindFormComponent
in class AbstractFormComponent
- See Also:
AbstractFormComponent.rewindFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)
getModel
public abstract IPropertySelectionModel getModel()
getValue
public abstract Object getValue()
- Since:
- 2.2 *
setValue
public abstract void setValue(Object value)
- Since:
- 2.2 *
getOptionRenderer
public abstract IOptionRenderer getOptionRenderer()
- Responsible for rendering individual options.
getValidatableFieldSupport
public abstract ValidatableFieldSupport getValidatableFieldSupport()
- Injected.
isRequired
public boolean isRequired()
- Description copied from class:
AbstractFormComponent
- Returns false. Subclasses that might be required must override this method. Typically, this
involves checking against the component's validators.
- Specified by:
isRequired
in interface IFormComponent
- Overrides:
isRequired
in class AbstractFormComponent
- See Also:
AbstractFormComponent.isRequired()
Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.