feat: Add API to control whether Binder converts back to presentation (#12246)
#12132 fixed an old bug, conversion was not done back, which was a regression from Vaadin 7. However since the bug has been present long time, it has become established behavior, thus there may be need to disable conversion back to presentation sometimes, thus this API as added.
Make asRequired conditional on binding.setAsRequiredEnabled(..) (#11834)
It is a very common use case in complex form that whether a field is required or not, it depends on input on other fields. Hypothetical use case sample could be that we have form for a Product and price of the product is needed except in case the Product's type is Sample. So in that kind of scenarios it would be needed to turn off asRequired() validation easily. The purpose of this enhancement and new binding.setAsRequiredEnabled(..) API is to help implementation of this kind of use cases more easily.
https://github.com/vaadin/framework/issues/10709
Add method writeBeanAsDraft(bean) in Binder (#11833)
* Add method writeBeanAsDraft(bean) in Binder
With current Binder implementation it is not easy to support Forms, which you want to save as draft, i.e. incomplete. For example there can be big text areas, that require time to fill, or lot of fields. Therefore it is needed to that form can be saved, e.g. to other bean in incomplete state when it is not yet passing validation and this other bean can be persisted to draft storage for further editing in the future. This method helps to achieve that easily.
* Add test case for Binder.writeBeanAsDraft(bean)
Bind a field with validator, set value that does not pass validator and save, assert that value was saved.
* Updating test
* Fixing logic flaw in test
* Further improvement of the test case
* Clarification of the JavaDoc
* Fixing typo
* JavaDoc language check
* Fixing whitespace issue
* Fixing whitespaces
* Fixing whitespaces
* Updating JavaDoc
Extract AbstractBeanPropertyDefinition and PropertyFilterDefinition (#10344)
This commit extracts the private nested class AbstractBeanPropertyDefinition from BeanPropertySet to a public class of package com.vaadin.data.
Additionally, the nested protected class PropertyFilterDefinition is extracted from NestedBeanPropertyDefinition to a public class in package com.vaadin.data.
* Added the possiblity of defining a Field as Required without
setting an error message.
* Added @since to asRequired()
* Add droped paragraphs and see tag for asRequired(String)
Fix BindingBuilder to always use the same instance (#10004)
This allows using BindingBuilder either in a type safe chained manner or with separate calls for the same instance at the cost of less strict type checking.
Fixes #9927
Fixes #9619
Improve Binder value change handling with bean validation (#9988)
Changed values are now only applied to the bean when they pass both field and bean validation. Any change that breaks validation will be pending and is attempted to apply when another change event comes.
This patch also makes the order of status change event handler and listener call order.
This addresses some of the issues raised in #9955.