TextField

A form element component that renders an <input> element.

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

Parameters

Name Type Required Default Description
value string yes The value to be editted, which is is usually a string. Tapestry has limited ability to convert to and from strings.
disabled boolean 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 no The user-presentable name for the component, which will be used by a FieldLabel connected to the component.
validators Array or collection of Validator no The validators to apply to the component. Something along the lines of: validators:required .



See also: Validation
translator Translator no The translator to use when displaying and parsing the date.



See also: Validation
hidden boolean 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

Example

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.
  }
}