| java.lang.Object org.apache.cocoon.forms.formmodel.AbstractWidget org.apache.cocoon.forms.formmodel.MultiValueField
MultiValueField | public class MultiValueField extends AbstractWidget implements ValidationErrorAware,SelectableWidget,DataWidget,ValueChangedListenerEnabled(Code) | | A MultiValueField is mostly the same as a normal
Field , but can
hold multiple values. A MultiValueField should have a Datatype which
has a SelectionList, because the user will always select the values
from a list. A MultiValueField has no concept of "required", you should
instead use the ValueCountValidationRule to check how many items the user
has selected.
A MultiValueField also has a
Datatype associated with it. In
case of MultiValueFields, this Datatype will always be an array
type, thus
Datatype.isArrayType will always return true, and
this in return has an influence on the kind of validation rules that
can be used with the Datatype (see
Datatype description for more
information).
version: $Id: MultiValueField.java 462520 2006-10-10 19:39:14Z vgritsenko $ |
getXMLElementName | public String getXMLElementName()(Code) | | "multivaluefield" |
hasValueChangedListeners | public boolean hasValueChangedListeners()(Code) | | |
initialize | public void initialize()(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 fd: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 fd:label child element
of every fd: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. |
validate | public boolean validate()(Code) | | |
Fields inherited from org.apache.cocoon.forms.formmodel.AbstractWidget | protected boolean wasValid(Code)(Java Doc)
|
|
|