Class NumberTextField<N extends Number & Comparable<N>>

Type Parameters:
N - the type of the number
All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<N,FormComponent<N>>, IMetadataContext<Serializable,Component>, IFormModelUpdateListener, IFormVisitorParticipant, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable
Direct Known Subclasses:
RangeTextField

public class NumberTextField<N extends Number & Comparable<N>> extends TextField<N>
A TextField for HTML5 <input> with type number.

The <input>'s value will be rendered in floating-point representation, as required by the HTML specification. Use a simple TextField to use a locale specific conversion of numbers.

Automatically validates the input against the configured min and max attributes. If any of them is null then respective MIN_VALUE or MAX_VALUE for the number type is used. If the number type has no minimum and/or maximum value then Double.MIN_VALUE and Double.MAX_VALUE are used respectfully.

See Also:
  • Field Details

    • ANY

      public static final Double ANY
      Use this as a marker of step attribute value "any" Because the w3c spec requires step to be a non-negative digit greater than zero we use zero as delegate for "any" keyword.
  • Constructor Details

    • NumberTextField

      public NumberTextField(String id)
      Construct.
      Parameters:
      id - The component id
    • NumberTextField

      public NumberTextField(String id, Class<N> type)
      Construct.
      Parameters:
      id - The component id
      type - The type to use when updating the model for this text field
    • NumberTextField

      public NumberTextField(String id, IModel<N> model)
      Construct.
      Parameters:
      id - The component id
      model - The input value
    • NumberTextField

      public NumberTextField(String id, IModel<N> model, Class<N> type)
      Construct.
      Parameters:
      id - The component id
      model - The input value
      type - The type to use when updating the model for this text field
  • Method Details