| java.lang.Object org.apache.cocoon.woody.formmodel.AbstractWidget org.apache.cocoon.woody.formmodel.Field
All known Subclasses: org.apache.cocoon.woody.formmodel.AggregateField,
Field | public class Field extends AbstractWidget implements ValidationErrorAware,DataWidget,SelectableWidget(Code) | | A general-purpose Widget that can hold one value. A Field widget can be associated
with a
org.apache.cocoon.woody.datatype.Datatype Datatype , and thus
a Field widget can be used to edit different kinds of data, such as strings,
numbers and dates. A Datatype can also have an associated SelectionList, so
that the value for the Field can be selected from a list, rather than being
entered in a textbox. The validation of the field is delegated to its associated
Datatype.
author: Bruno Dumon author: Sylvain Wallez version: CVS $Id: Field.java 433543 2006-08-22 06:22:54Z crossley $ |
needsParse | protected boolean needsParse(Code) | | |
needsValidate | protected boolean needsValidate(Code) | | |
isRequired | public boolean isRequired()(Code) | | |
readFromRequest | protected void readFromRequest(String newEnteredValue)(Code) | | |
setSelectionList | public void setSelectionList(SelectionList selectionList)(Code) | | Set this field's selection list.
Parameters: selectionList - The new selection list. |
setSelectionList | public void setSelectionList(String uri)(Code) | | Read this field's selection list from an external source.
All Cocoon-supported protocols can be used.
The format of the XML produced by the source should be the
same as in case of inline specification of the selection list,
thus the root element should be a wd:selection-list
element.
Parameters: uri - The URI of the source. |
setSelectionList | public void setSelectionList(Object model, String valuePath, String labelPath)(Code) | | Set this field's selection list using values from an in-memory
object. The object parameter should point to a collection
(Java collection or array, or Javascript array) of objects. Each object
belonging to the collection should have a value property and a
label property, whose values are used to specify the value
attribute and the contents of the wd:label child element
of every wd:item in the list.
Access to the values of the above mentioned properties is done
via XPath expressions.
Parameters: model - The collection used as a model for the selection list. Parameters: valuePath - An XPath expression referring to the attribute usedto populate the values of the list's items. Parameters: labelPath - An XPath expression referring to the attribute usedto populate the labels of the list's items. |
setValidationError | public void setValidationError(ValidationError error)(Code) | | Set a validation error on this field. This allows fields to be externally marked as invalid by
application logic.
Parameters: error - the validation error |
|
|