A form element component that renders an <input> element.
See also: org.apache.tapestry.form.TextField , Form
Name | Type | Direction | Required | Default | Description |
---|---|---|---|---|---|
value | string | in / out | yes | The value to be editted, which is is usually a string. Tapestry has limited ability to convert to and from strings. | |
disabled | boolean | in | no | false | If true, then a disabled attribute will be rendered as part of the <input> tag, and the component will not update its value parameter when the form is submitted. |
displayName | string | in | no | The user-presentable name for the component, which will be used by a FieldLabel connected to the component. | |
hidden | boolean | in | no | false | If true, then the type attribute will be "password", not "text", and user input in the browser will be masked. |
Body: removed
Informal parameters: allowed
Reserved parameters: name, type, value
Below is an excerpt from a Login page, that collects a user id and a password.
Login.html: (partial)
<form jwcid="form@Form" success="listener:doLogin"> <table> <tr> <th>User id:</th> <td><input jwcid="userId@TextField" value="ognl:userId" size="8"/></td> </tr> <tr> <th>Password:</th> <td><input jwcid="password@TextField" value="ognl:password" size="8" hidden="true"/></td> </tr> <tr> <td colpsan="2"> <input type="submit" value="Login"/> </td> </tr> </table> </form>
Login.java:
public abstract class Login extends BasePage { public abstract String getUserId(); public abstract String getPassword(); public void doLogin() { // Talk to back end system, etc. } }