Apache » Cocoon »

  Cocoon Forms

Cocoon Forms 1.0

Aggregatefield widget


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.


<fd:aggregatefield id="..." state="...">
    <fd:field .../>
    [... more fd:field elements ...]
  <fd:split pattern="...">
    <fd:map group="..." field="..."/>
    [... more fd:map elements ...]
  <fd:combine expression="..."/>
    <fd:attribute name="..." value="..."/>
Errors and Improvements? If you see any errors or potential improvements in this document please help us: View, Edit or comment on the latest development version (registration required).