Form

A Form component must enclose the other form element components (such as TextField and Checkbox ). It manages the rendering of the form as well as processing when the form is submitted (known as "rewinding" the form). In traditional web applications, the developer is responsible for providing a name for each form and each form control element; in Tapestry, the Form component generates its own unique name, and unique names for each enclosed component ... this is necessary to support advanced features such as loops within forms.

See also: org.apache.tapestry.form.Form , IValidationDelegate

Parameters

Name Type Direction Required Default Description
method string in no post Method used by the form when it is submitted.
success IActionListener in no Listener invoked when the form is submitted normally (not a cancel or a refresh) and the validation delegate indicates no errors. If the delegate indicates errors, then the listener parameter (if non-null) is used instead.
cancel IActionListener in no Listener used when a form is cancelled, overriding the default listener. Forms are cancelled by invoking the client-side JavaScript function document. form-name .events.cancel(). A cancelled form does not rewind. If no cancel listener is provided, then the normal listener will be used.
refresh IActionListener in no Listener used when a form is refreshed, overriding the default listener. A refreshed form bypasses input field validation on the client side, though validation still occurs on the server side. If no refresh listener is provided, then the normal listener will be used.
listener IActionListener in no Default listener to be invoked when the form is submitted. Invoked only if another listener (success, cancel or refresh) is not invoked.
stateful boolean in no true If true (the default), then an active session is required when the form is submitted, if there was an active session when the form was rendered.
delegate IValidationDelegate in no default instance An object that tracks user input and input field errors, and decorates fields and field labels. This is typically overriden to provide an application-specific look and feel.
clientValidationEnabled boolean in no false If true, then client-side validation will be enabled for components that support it (such as TextField ).
focus boolean in no true If true (the default), the the Form will determine a field to receive input focus, and add JavaScript to move the cursor to that field. Priority is given to fields in error, then required fields, then any non-disabled field. On a page with multiple forms, use this parameter to control which form will take focus.
scheme String in no The required scheme ("http" or "https", typically) for the URL. This will force the creation of an absolute URL when the current request's scheme does not match the value for this parameter. This is most often used to switch to "https" for secure portions of an application (such as a login page), before switching back to standard "http" for the majority of an application.
port Integer in no The required port (80, 443, 8080. 8443, typically) for the URL. This will force the creation of an absolute URL when the current request's scheme does not match the value for this parameter. This is most often used in conjunction with scheme to switch to "https:443"/"https:8443" for secure portions of an application (such as a login page), before switching back to standard "http:80"/"http:80" for the majority of an application.
updateComponents String[],Collection in no In an asynchronous request, specifies which components should have their content rendered back to the client. These are expected to be unique component ids.

See: ResponseBuilder

json boolean in no false Causes the request to be asynchronous and the response to be captured/rendered via the JSONResponseBuilder renderer.
async boolean in no false Causes the request to be asynchronous and the response to be captured/rendered via the DojoAjaxResponseBuilder renderer.

Body: allowed

Informal parameters: allowed

Reserved parameters: action, enctype, id, name, onreset, onsubmit

A note about clientValidationEnabled: This refers to the revamped input validation support that debuts in Tapestry 4.0.