An HTML form, which will enclose other components to render out the various types of fields. A Form emits many notification events. When it renders, it fires a EventConstants#PREPARE_FOR_RENDER notification, followed by a EventConstants#PREPARE notification. When the form is submitted, the component emits several notifications: first a EventConstants#PREPARE_FOR_SUBMIT, then a EventConstants#PREPARE: these allow the page to update its state as necessary to prepare for the form submission, then (after components enclosed by the form have operated), a EventConstants#VALIDATE_FORM event is emitted, to allow for cross-form validation. After that, either a EventConstants#SUCCESS OR EventConstants#FAILURE event (depending on whether the ValidationTracker has recorded any errors). Lastly, a EventConstants#SUBMIT event, for any listeners that care only about form submission, regardless of success or failure. For all of these notifications, the event context is derived from the context parameter. This context is encoded into the form's action URI (the parameter is not read when the form is submitted, instead the values encoded into the form are used).
| Name | Type | Flags | Default | Default Prefix | Since | Description |
|---|---|---|---|---|---|---|
| autofocus | boolean | NOT Allow Null | prop | If true (the default), then the JavaScript will be added to position the cursor into the form. The field to receive focus is the first rendered field that is in error, or required, or present (in that order of priority). | ||
| clientValidation | boolean | NOT Allow Null | prop | If true (the default) then client validation is enabled for the form, and the default set of JavaScript libraries (Prototype, Scriptaculous and the Tapestry library) will be added to the rendered page, and the form will register itself for validation. This may be turned off when client validation is not desired; for example, when many validations are used that do not operate on the client side at all. | ||
| context | Object | NOT Allow Null | prop | The context for the link (optional parameter). This list of values will be converted into strings and included in the URI. The strings will be coerced back to whatever their values are and made available to event handler methods. | ||
| tracker | ValidationTracker | NOT Allow Null | defaultTracker | prop | The object which will record user input and validation errors. The object must be persistent between requests (since the form submission and validation occurs in an component event request and the subsequent render occurs in a render request). The default is a persistent property of the Form component and this is sufficient for nearly all purposes (except when a Form is rendered inside a loop). | |
| validationId | String | NOT Allow Null | prop | Prefix value used when searching for validation messages and constraints. The default is the Form component's id. This is overriden by BeanEditForm. | ||
| zone | String | NOT Allow Null | literal | Binding the zone parameter will cause the form submission to be handled as an Ajax request that updates the indicated zone. Often a Form will update the same zone that contains it. |
<t:form t:id="search"/>
rather than
<t:form t:id="searchData"/>
or
<t:form t:id="searchForm"/>.