FieldBinder
FieldBinder is a single field binding buffer, a little sibling to Binder with similar API
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);
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
Version 2.0.0
- Migrated the add-on for Vaadin 14 (works probably also with 10-13)
- Released
- 2019-12-30
- Maturity
- BETA
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 10+
- Vaadin 8.0+ in 0.2.0
- Browser
- Browser Independent
Vaadin CDI - Vaadin Add-on Directory
Contexts and Dependency Injection for VaadinIssue Tracker
Source Code
Tutorial
Java EE Compatibility Matrix
Vaadin CDI version 1.0.0.alpha1
null
Vaadin CDI version 1.0.0.alpha2
Fixes three critical bugs relating to closing UIs or VaadinSessions.
Vaadin CDI version 1.0.0.alpha3
Main changes include
- Reintroduce conventions for mapping of views and UIs
- This requires updating @CDIUI and @CDIView parameter values in existing
applications - see http://dev.vaadin.com/ticket/12385 for details
- @UIScoped is inherited by subclasses of an annotated UI
- Support non-JEE containers with Weld (BeanManager look-up)
- Automatically injected servlet has async-supported enabled
- See http://dev.vaadin.com/query?status=closed&milestone=Vaadin+CDI+1.0.0.alpha3
for the complete list of changes.
Vaadin CDI version 1.0.0.beta1
- @ViewScoped context
- @UIScoped and @ViewScoped use @NormalScope, supporting interceptors etc.
- Better support for server push (including WebSockets) and operations in
background threads (within UI.access())
- DeltaSpike library is used internally by the add-on
- Various fixes and small enhancements
- See http://dev.vaadin.com/query?status=closed&status=released&milestone=Vaadin+CDI+1.0.0.beta1
for the complete list of changes.
Note that injecting components requires Vaadin 7.3.1 or later. Other functionality requires Vaadin 7.2 or later.
Vaadin CDI version 1.0.0.beta2
- @UIScoped and @ViewScoped can be used on methods (producer methods, setter injection, constructor injection)
- Dependency on Guava eliminated
- Various fixes including
- UI and View are now correctly included in their own scopes
- Sub-views with slash in view name are now handled correctly
Vaadin CDI version 1.0.0.beta3
- breaking change: @UIScoped and @ViewScoped are no longer @NormalScope
- added corresponding @NormalUIScoped and @NormalViewScoped
- breaking change: NormalScopes (including @NormalUIScoped and
@NormalViewScoped) are not supported classes implementing
com.vaadin.ui.Component
Vaadin CDI version 1.0.0.beta4
Do not block the use of components in normal scopes (@NormalUIScope, @NormalViewScope)
Vaadin CDI version 1.0.0.rc1
- moved the classes VaadinCDIServlet and VaadinCDIServletService to the package com.vaadin.cdi.servlet
- do not add hyphens within all caps abbreviations in automatic UI/view names, e.g. MyCDIUI becomes my-cdi and MyCDITestView becomes my-cdi-test
- added check at deployment time: classes with @CDIView must implement View
- added check at deployment time: if a servlet class is nested in a UI with @CDIUI, it must extend VaadinCDIServlet
Vaadin CDI version 1.0.0
No changes since 1.0.0.rc1
Vaadin CDI version 1.0.1
Upgrade to DeltaSpike 1.0.3 for GlassFish 4.1 compatibility
Vaadin CDI version 1.0.3
Upgrade to DeltaSpike 1.4.1.
In case of compatibility problems, an explicit dependency to DeltaSpike 1.3.0 can be used in the project POM to override the dependency.
Vaadin CDI version 2.0.0.beta1
Vaadin CDI add-on for Vaadin Framework 8.0.0.beta1
Available from the pre-releases repository, i.e. for maven:
```xml
Vaadin CDI version 2.0.0.rc1
Compatible with Vaadin Framework 8.0.0.rc1
Vaadin CDI version 2.0.0
Compatible with Vaadin Framework 8.0.
Fix for UI cleanup within session.
Vaadin CDI version 3.0.0.alpha1
See https://github.com/vaadin/cdi/releases/tag/3.0.0.alpha1
Vaadin CDI version 1.0.4
Fix closed UI cleanup.
Open CDIViewProvider methods getViewBean() and parseViewName() for extension.
Update DeltaSpike to 1.7.2.
Vaadin CDI version 3.0.0
See [release notes](https://github.com/vaadin/cdi/releases/tag/3.0.0) at GitHub.
Vaadin CDI version 1.0.5
1.0.5 has following fixes:
- Improvements in the closed `UI` cleanup
- `@PreDestroy` is now called properly
- Fix `VaadinServlet` detection with Liberty, JAX-WS and JAX-RS
In this version there is a possible issue still in `UI` cleanup with WELD.
Vaadin CDI version 3.0.1
3.0.1 has following fixes:
- Add context path to UI path info
- Fix deploying with JAX-WS, JAX-RS Liberty
Vaadin CDI version 10.0.0
This is the first stable release for CDI for Vaadin 10+.
Vaadin CDI version 11.0.0
the official Flow CDI integration that is compatible with Vaadin 14.