NumberField (Vaadin 8)
NumberField converted to Vaadin 8
Original Vaadin 6 version Vaadin 7 version Vaadin 7 compatibility version for Vaadin 8 projects
Sample code
final NumberField numberField = new NumberField(); numberField.setLocale(Locale.FRANCE); numberField.setCaption("Modified settings:"); numberField.setDecimalPrecision(2); numberField.setDecimalSeparator(','); numberField.setGroupingSeparator('.'); numberField.setDecimalSeparatorAlwaysShown(true); numberField.setMinimumFractionDigits(2); numberField.setMinValue(5); final Binder<Bean> binder = new Binder<>(Bean.class); binder.forField(numberField) .withConverter(NumberField.getConverter("Conversion error")) .bind("number"); binder.setBean(new Bean()); layout.addComponent(numberField);
Links
Compatibility
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
- Vaadin 8 & Java 8
- Default validation happens in ValueChangeListener because there are no more validators in fields
- There is no automated converter because that also doesn't happen within fields anymore, you need to add NumberField.getConverter() to your Binder
- Small API tweaks
- Released
- 2017-03-31
- Maturity
- EXPERIMENTAL
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 8.0+
- Browser
- N/A
NumberField (Vaadin 7) - Vaadin Add-on Directory
NumberField converted to Vaadin 7Discussion Forum
Issue Tracker
NumberField (Vaadin 7) version 0.1.0
Quick conversion with minor refactoring.
NumberField (Vaadin 7) version 0.1.3
Quick fixes for some localization problems, added pom.xml
NumberField (Vaadin 7) version 0.1.4
- Use shared state instead of legacy communication.
- Upgrade to use Vaadin 7.6.4
NumberField (Vaadin 7) version 0.1.5
Prevent entering letters when SHIFT is pressed (solution by Tamás Ambrits, thank you for the contribution!)
NumberField (Vaadin 7) version 0.1.6
Quick fix for an issue caused by moving to use shared state instead of legacy communication.
NumberField (Vaadin 7) version 0.1.7
NPE fix by Olli Tietäväinen, thanks for the contribution!
NumberField (Vaadin 7) version 0.1.8
Validation fix, thanks to Victor Tarasov for the contribution!