Class EmailTextField

All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<String,FormComponent<String>>, IMetadataContext<Serializable,Component>, IFormModelUpdateListener, IFormVisitorParticipant, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class EmailTextField extends TextField<String>
A TextField for HTML5 <input> with type email.

Automatically validates that the input is a valid email address.

Note: This component does not support multiple values! That is <input type="email" multiple .../> cannot be validated with the default email validator

See Also:
  • Constructor Details

    • EmailTextField

      public EmailTextField(String id, String emailAddress)
      Construct.
      Parameters:
      id - component id
      emailAddress - the email input value
    • EmailTextField

      public EmailTextField(String id, IValidator<String> emailValidator)
      Construct.

      Use this constructor when the model will be provided by a parent component.

      Parameters:
      id - component id
      emailValidator - the validator that will check the correctness of the input value
    • EmailTextField

      public EmailTextField(String id, IModel<String> model)
      Construct.
      Parameters:
      id - see Component
      model - the model
    • EmailTextField

      public EmailTextField(String id)
      Construct.

      Use this constructor when the model will be provided by a parent component.

      Parameters:
      id - see Component
    • EmailTextField

      public EmailTextField(String id, IModel<String> model, IValidator<String> emailValidator)
      Construct.
      Parameters:
      id - the component id
      model - the input value
      emailValidator - the validator that will check the correctness of the input value
  • Method Details

    • getInputTypes

      protected String[] getInputTypes()
      Description copied from class: TextField
      Subclass should override this method if this textfield is mapped on a different input type as text. Like PasswordTextField or HiddenField.
      Overrides:
      getInputTypes in class TextField<String>
      Returns:
      The input type of this textfield, default is null