Numeric text field with automatic keystroke filtering and validation for integer (123) and decimal numbers (12.3).

NumberField provides a numeric text field with automatic keystroke filtering and validation for integer (123) and decimal numbers (12.3). The minus sign and user-definable grouping and decimal separators are supported.

Inputs are validated on client- and server-side. The client-side validator gets active on every keypress in the field. If the keypress would lead to an invalid value, it is suppressed and the value remains unchanged. The server-side validation is triggered when the field loses focus.

An user-entered value is formatted automatically when the field's focus is lost. NumberField uses Java's DecimalFormat for formatting and send the formatted value of the input back to client. There's a number of setters to define the format, see the code example below for a general view.

Install

Link to this version
BetaReleased 05 July 2012Apache License 2.0
Framework Support
Vaadin 6.2+
Install with
Release notes - Version 0.5.1

Added setValue() for double types