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 org.apache.tapestry.corelib.components.Form#PREPARE_FOR_RENDER notification, followed by a org.apache.tapestry.corelib.components.Form#PREPARE notification. When the form is submitted, the component emits several notifications: first a org.apache.tapestry.corelib.components.Form#PREPARE_FOR_SUBMIT, then a org.apache.tapestry.corelib.components.Form#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 org.apache.tapestry.corelib.components.Form#VALIDATE_FORMevent is emitted, to allow for cross-form validation. After that, either a org.apache.tapestry.corelib.components.Form#SUCCESS OR org.apache.tapestry.corelib.components.Form#FAILURE event (depending on whether the org.apache.tapestry.ValidationTracker has recorded any errors). Lastly, a org.apache.tapestry.corelib.components.Form#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 | Description |
|---|---|---|---|---|---|
| clientValidation | boolean | true | 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 | java.util.List | 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 | org.apache.tapestry.ValidationTracker | 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). | |
| zone | String | 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"/>.