|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.primix.tapestry.AbstractComponent | +--com.primix.tapestry.form.AbstractFormComponent | +--com.primix.tapestry.form.PropertySelection
A component which uses either
<select> and <option> elements
or <input type=radio> 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 a particular Enum
to assign to a property; the
EnumPropertySelectionModel
class simplifies this.
Parameter | Type | Read / Write | Required | Default | Description |
value | java.lang.Object | R / W | yes | The property to set. During rendering, this property is read, and sets the default value of the selection (if it is null, no element is selected). When the form is submitted, this property is updated based on the new selection. | |
renderer | IPropertySelectionRenderer |
R | no | shared instance of SelectPropertySelectionRenderer |
Defines the object used to render the PropertySelection.
|
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 |
Informal parameters are allowed, and are applied to the <select> element. A body is not allowed.
Field Summary | |
static IPropertySelectionRenderer |
DEFAULT_RADIO_RENDERER
A shared instance of RadioPropertySelectionRenderer . |
static IPropertySelectionRenderer |
DEFAULT_SELECT_RENDERER
A shared instance of SelectPropertySelectionRenderer . |
Fields inherited from class com.primix.tapestry.AbstractComponent |
id, page, specification, wrapped, wrappedCount |
Constructor Summary | |
PropertySelection()
|
Method Summary | |
IPropertySelectionRenderer |
getDefaultRadioRenderer()
Deprecated. Use instead . |
IPropertySelectionRenderer |
getDefaultSelectRenderer()
Deprecated. Use DEFAULT_SELECT_RENDERER instead. |
IBinding |
getDisabledBinding()
|
IBinding |
getModelBinding()
|
java.lang.String |
getName()
Returns the name assigned to this PropertySelection by the Form
that wraps it. |
IBinding |
getRendererBinding()
|
IBinding |
getValueBinding()
|
boolean |
isDisabled()
Returns true if this PropertySelection's disabled parameter yields true. |
void |
render(IResponseWriter writer,
IRequestCycle cycle)
Renders the component, much of which is the responsiblity of the renderer . |
void |
setDisabledBinding(IBinding value)
|
void |
setModelBinding(IBinding value)
|
void |
setRendererBinding(IBinding value)
|
void |
setValueBinding(IBinding value)
|
Methods inherited from class com.primix.tapestry.form.AbstractFormComponent |
getForm, getForm |
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 |
Field Detail |
public static final IPropertySelectionRenderer DEFAULT_SELECT_RENDERER
SelectPropertySelectionRenderer
.public static final IPropertySelectionRenderer DEFAULT_RADIO_RENDERER
RadioPropertySelectionRenderer
.Constructor Detail |
public PropertySelection()
Method Detail |
public IBinding getValueBinding()
public void setValueBinding(IBinding value)
public IBinding getModelBinding()
public void setModelBinding(IBinding value)
public IBinding getDisabledBinding()
public void setDisabledBinding(IBinding value)
public void setRendererBinding(IBinding value)
public IBinding getRendererBinding()
public java.lang.String getName()
Form
that wraps it.getName
in class AbstractFormComponent
public boolean isDisabled()
public IPropertySelectionRenderer getDefaultSelectRenderer()
DEFAULT_SELECT_RENDERER
instead.
SelectPropertySelectionRenderer
instance.
This is a shared instance.public IPropertySelectionRenderer getDefaultRadioRenderer()
instead
.
RadioPropertySelectionRenderer
.public void render(IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
renderer
. The possible options,
thier labels, and the values to be encoded in the form are provided
by the model
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |