Directory

← Back

FieldBinder

FieldBinder is a single field binding buffer, a little sibling to Binder with similar API

Author

Rating

Popularity

<100

FieldBinder Add-on for Vaadin 8 & 10+

FieldBinder is a little sibling of Binder for special case of single field bindings. FieldBinder enables to use same Converters, Validators and similar API to Binder with single field binding.

FieldBinder connects one Field component with value with one direction binding.

A binder is a binding, representing the mapping of a single field, through converters and validators, and acts as a buffer for bound value.

A binder instance can be bound to a single value and field instance at a time, but can be rebound as needed.

This add-on does not have client side implementation, widgetset compilation is not needed.

Sample code

        // Binder with integer
        FieldBinder<Integer> integerFieldBinder = new FieldBinder<>();
        TextField integerField = new TextField("Input number");

        // Text field with Integer value Converter and Validator
        // Demoing how to detect if value is valid and how to get it from FieldBinding
        FieldBinding<Integer> integerBinding = integerFieldBinder.forField(integerField)
        		.withConverter(new StringToIntegerConverter("This is not a number"))
        		.withValidator(new IntegerRangeValidator("Give a number between 5 and 10",5,10))
        		.bind(integerValue);

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

Version 0.2.0

  • Added FieldBinder.of(..) short hand.
Released
2018-10-13
Maturity
BETA
License
Apache License 2.0

Compatibility

Framework
Vaadin 8.0+
Vaadin 10+ in 2.0.0
Browser
N/A

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online