Directory

← Back

numberfield7 - NumberField7 Add-on

TextField which allows only number input

Author

Rating

Popularity

<100

This addon is a modification of TextField, which accepts only number input and has new properties.

  1. Enable/disable negative values #setSigned. Default true.
  2. Enable/disable number grouping #setUseGrouping. Default false.
  3. Setting grouping separator #setGroupingSeparator. Default character dot character.
  4. Enable/disable decimal numbers #setDecimal. Default false.
  5. Setting decimal separator #setDecimalSeparator. Default value space character.

If you want to get converted value, you need to use binder and set custom converter by calling binderBuilder.forField(field) .withConverter(createStringToIntegerConverter())

For demo you could checkout and run demo app from here.

Sample code

    public NumberField createInstance() {
        NumberField field = new NumberField("Amount");
        field.setSigned(false);                                                 // disable negative sign, default true
        field.setUseGrouping(true);                                        // enable grouping, default false
        field.setGroupingSeparator(' ');                                  // set grouping separator ' '
        field.setDecimal(true);                                               // enables input of decimal numbers, default false
        field.setDecimalSeparator('.');                                   // set decimal separator, default '.'
        field.setConverter(converter);                                   // custom converter
        return field;
    }

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Upgrade to Vaadin 8

Released
2017-07-11
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 8.0+
Vaadin 7.4+ in 0.0.4
Browser
N/A

numberfield7 - NumberField7 Add-on - Vaadin Add-on Directory

TextField which allows only number input numberfield7 - NumberField7 Add-on - Vaadin Add-on Directory
This addon is a modification of TextField, which accepts only number input and has new properties. 1. Enable/disable negative values #setSigned. Default true. 2. Enable/disable number grouping #setUseGrouping. Default false. 3. Setting grouping separator #setGroupingSeparator. Default character dot character. 4. Enable/disable decimal numbers #setDecimal. Default false. 5. Setting decimal separator #setDecimalSeparator. Default value space character. If you want to get converted value, you need to use binder and set custom converter by calling ` binderBuilder.forField(field)` `.withConverter(createStringToIntegerConverter())` For demo you could checkout and run demo app from [here](https://github.com/ojkey/master/tree/master/vaadinWidgets/vaadin-demo).
Online