Abstract class for a variety of components that render some variation of a text field. Most of the hooks for user input validation are in this class. In particular, all subclasses support the "toclient" and "parseclient" events. These two events allow the normal Translator (specified by the translate parameter, but often automatically derived by Tapestry) to be augmented. If the component container (i.e., the page) provides an event handler method for the "toclient" event, and that handler returns a non-null string, that will be the string value sent to the client. The context passed to the event handler method is t he current value of the value parameter. Likewise, on a form submit, the "parseclient" event handler method will be passed the string provided by the client, and may provide a non-null value as the parsed value. Returning null allows the normal translator to operate. The event handler may also throw ValidationException.
| Name | Type | Flags | Default | Default Prefix | Description |
|---|---|---|---|---|---|
| annotationProvider | AnnotationProvider | NOT Allow Null | prop | Provider of annotations used for some defaults. Annotation are usually provided in terms of the value parameter (i.e., from the getter and/or setter bound to the value parameter). | |
| clientId | String | NOT Allow Null | prop:componentResources.id | literal | The id used to generate a page-unique client-side identifier for the component. If a component renders multiple times, a suffix will be appended to the to id to ensure uniqueness. The uniqued value may be accessed via the clientId property. |
| disabled | boolean | NOT Allow Null | false | prop | If true, then the field will render out with a disabled attribute (to turn off client-side behavior). Further, a disabled field ignores any value in the request when the form is submitted. |
| label | String | NOT Allow Null | literal | The user presentable label for the field. If not provided, a reasonable label is generated from the component's id, first by looking for a message key named "id-label" (substituting the component's actual id), then by converting the actual id to a presentable string (for example, "userId" to "User Id"). | |
| nulls | NullFieldStrategy | NOT Allow Null | default | nullfieldstrategy | Defines how nulls on the server side, or sent from the client side, are treated. The selected strategy may replace the nulls with some other value. The default strategy leaves nulls alone. Another built-in strategy, zero, replaces nulls with the value 0. |
| translate | FieldTranslator | Required, NOT Allow Null | translate | The object which will perform translation between server-side and client-side representations. If not specified, a value will usually be generated based on the type of the value parameter. | |
| validate | FieldValidator | NOT Allow Null | validate | The object that will perform input validation (which occurs after translation). The validate binding prefix is generally used to provide this object in a declarative fashion. | |
| value | Object | Required, NOT Allow Null | prop | The value to be read and updated. This is not necessarily a string, a translator may be provided to convert between client side and server side representations. If not bound, a default binding is made to a property of the container matching the component's id. If no such property exists, then you will see a runtime exception due to the unbound value parameter. |