|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.woody.formmodel.AbstractWidget org.apache.cocoon.woody.formmodel.Field org.apache.cocoon.woody.formmodel.AggregateField
public class AggregateField
An aggregated field allows to represent one value as multiple input fields, or several values as one field. Hence this widget is a field and a container widget simultaneously.
Upon submit, it first attempts to read own value from the request, and splits over nested field widgets using a regular expression. If split fails, this will simply give a validation error. If own value was not submitted, it attempts to read values for nested field widgets, and combines theirs values using combine expression.
To validate this widget, both the validation rules of the nested widgets are checked, and those of the aggregated field themselves. The validation rules of the aggregated field can perform checks on the string as entered by the user (e.g. check its total length).
This field and nested fields can be of any supported type, as long as combine expression gives result of the correct type, and split regular expression can split string representation into parts which can be converted to the values of nested fields.
Field Summary |
---|
Fields inherited from class org.apache.cocoon.woody.formmodel.Field |
---|
enteredValue, needsParse, needsValidate, selectionList, validationError, value |
Fields inherited from class org.apache.cocoon.woody.formmodel.AbstractWidget |
---|
definition |
Constructor Summary | |
---|---|
AggregateField(AggregateFieldDefinition definition)
|
Method Summary | |
---|---|
protected void |
addField(Field field)
|
void |
combineFields()
|
void |
generateLabel(ContentHandler contentHandler)
Generates SAX events for the label of this widget. |
void |
generateSaxFragment(ContentHandler contentHandler,
Locale locale)
Generates an XML representation of this widget. |
AggregateFieldDefinition |
getAggregateFieldDefinition()
|
Iterator |
getChildren()
|
Widget |
getWidget(String id)
Gets the child widget of this widget with the given id, or null if there isn't such a child. |
void |
readFromRequest(FormContext formContext)
Lets this widget read its data from a request. |
void |
setValue(Object newValue)
Sets the value of this widget to the given object. |
boolean |
validate(FormContext formContext)
Validates this widget and returns the outcome. |
Methods inherited from class org.apache.cocoon.woody.formmodel.Field |
---|
broadcastEvent, getDatatype, getFieldDefinition, getId, getValidationError, getValue, isRequired, readFromRequest, setSelectionList, setSelectionList, setSelectionList, setValidationError |
Methods inherited from class org.apache.cocoon.woody.formmodel.AbstractWidget |
---|
addValidator, generateItemSaxFragment, generateSaxFragment, getForm, getFullyQualifiedId, getLocation, getNamespace, getParent, removeValidator, setDefinition, setLocation, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.cocoon.woody.formmodel.Widget |
---|
getForm, getFullyQualifiedId, getLocation, getNamespace, getParent, setParent |
Constructor Detail |
---|
public AggregateField(AggregateFieldDefinition definition)
Method Detail |
---|
public final AggregateFieldDefinition getAggregateFieldDefinition()
protected void addField(Field field)
public Iterator getChildren()
public void readFromRequest(FormContext formContext)
Widget
readFromRequest
in interface Widget
readFromRequest
in class Field
public void setValue(Object newValue)
Widget
setValue
in interface Widget
setValue
in class Field
public void combineFields()
public boolean validate(FormContext formContext)
Widget
Widget.generateSaxFragment(ContentHandler, Locale)
method.
validate
in interface Widget
validate
in class Field
public void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException
Widget
generateSaxFragment
in interface Widget
generateSaxFragment
in class Field
SAXException
public void generateLabel(ContentHandler contentHandler) throws SAXException
Widget
generateLabel
in interface Widget
generateLabel
in class Field
SAXException
public Widget getWidget(String id)
Widget
getWidget
in interface Widget
getWidget
in class AbstractWidget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |