net.sf.tapestry.contrib.form
Class MultiplePropertySelection
java.lang.Object
|
+--com.primix.tapestry.AbstractComponent
|
+--com.primix.tapestry.form.AbstractFormComponent
|
+--net.sf.tapestry.contrib.form.MultiplePropertySelection
- All Implemented Interfaces:
- IComponent, IFormComponent, IRender
- public class MultiplePropertySelection
- extends AbstractFormComponent
A component which uses <input type=checkbox> to
set a property of some object. Typically, the values for the object
are defined using an Enum
. A PropertySelection is dependent on
an {link IPropertySelectionModel} to provide the list of possible values.
Often, this is used to select one or more Enum
to assign to a property; the
EnumPropertySelectionModel
class simplifies this.
Parameter |
Type |
Read / Write |
Required |
Default |
Description |
selectedList |
java.util.List |
R / W |
yes |
|
The property to set. During rendering, this property is read, and sets
the default value of the options in the select.
When the form is submitted, list is cleared, then has each
selected option added to it. |
renderer |
IMultiplePropertySelectionRenderer |
R |
no |
shared instance of CheckBoxMultiplePropertySelectionRenderer |
Defines the object used to render this component. The default
renders a table of checkboxes. |
model |
IPropertySelectionModel |
R |
yes |
|
The model provides a list of possible labels, and matches those labels
against possible values that can be assigned back to the property. |
disabled |
boolean |
R |
no |
false |
Controls whether the <select> is active or not. A disabled PropertySelection
does not update its value parameter.
Corresponds to the disabled HTML attribute. |
Informal parameters are not allowed.
- Version:
- $Id: MultiplePropertySelection.java,v 1.3 2001/09/10 18:25:13 hship Exp $
- Author:
- Sanjay Munjal
Methods inherited from class com.primix.tapestry.AbstractComponent |
addAsset, addComponent, addWrapped, cleanupAfterRender, cleanupComponent, finishLoad, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getPage, getSpecification, prepareForRender, renderWrapped, reset, setBinding, setContainer, setId, setPage, setSpecification, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.primix.tapestry.IComponent |
addAsset, addComponent, addWrapped, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getPage, getSpecification, renderWrapped, setBinding, setContainer, setId, setPage, setSpecification |
DEFAULT_CHECKBOX_RENDERER
public static final IMultiplePropertySelectionRenderer DEFAULT_CHECKBOX_RENDERER
- A shared instance of
CheckBoxPropertySelectionRenderer
.
MultiplePropertySelection
public MultiplePropertySelection()
getSelectedListBinding
public IBinding getSelectedListBinding()
setSelectedListBinding
public void setSelectedListBinding(IBinding value)
getModelBinding
public IBinding getModelBinding()
setModelBinding
public void setModelBinding(IBinding value)
getDisabledBinding
public IBinding getDisabledBinding()
setDisabledBinding
public void setDisabledBinding(IBinding value)
setRendererBinding
public void setRendererBinding(IBinding value)
getRendererBinding
public IBinding getRendererBinding()
getName
public java.lang.String getName()
- Returns the name assigned to this PropertySelection by the
Form
that wraps it.
- Overrides:
getName
in class AbstractFormComponent
isDisabled
public boolean isDisabled()
- Returns true if the component is disabled (this is relevant to the
renderer).
render
public void render(IResponseWriter writer,
IRequestCycle cycle)
throws RequestCycleException
- Renders the component, much of which is the responsiblity
of the
renderer
. The possible options,
their labels, and the values to be encoded in the form are provided
by the model
.