| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
| |
(#12360)
This is both a optimization by skipping duplicate validation round and avoids ConcurrentModificationExpectation being thrown certain corner cases.
|
|
|
| |
#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.
|
|
|
| |
See: https://vaadin.com/forum/thread/15931682
|
|
|
|
|
|
|
|
|
| |
- Enable / disable all validators on Binder level
- Enable / disable validators on Binding level
- add writeBeanAsDraft(bean,boolean) for writing draft bean with validators disabled
Fixes https://github.com/vaadin/framework/issues/10709
Co-authored-by: Zhe Sun <31067185+ZheSun88@users.noreply.github.com>
|
|
|
|
|
| |
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
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
|
|
|
|
|
|
|
|
|
|
| |
* Cherry picks of Binder fixes in Flow
Addresses: https://github.com/vaadin/framework/issues/9000
Addresses: https://github.com/vaadin/framework/issues/11109
These changes are adopted from https://github.com/vaadin/flow/pull/4138 and https://github.com/vaadin/flow/pull/6757
|
| |
|
|
|
|
| |
(#10724)
|
|
|
| |
Fixes #9917
|
| |
|
|
|
|
| |
* Add missing null check to Binding
|
| |
|
|
|
| |
Fixes #10476
|
|
|
|
|
|
|
| |
Binder.setReadonly will ignore bindings with null setter
or property without an accessible setter when changing
field read only flag.
Fixes #10252
|
|
|
| |
This patch also adds ValueChangeEvent as a parameter to field value change method in Binder.
|
| |
|
|
|
|
|
|
|
|
| |
* Simplify lambda expressions
And remove unneeded 'return' keyword.
* Format
|
|
|
| |
Fixes #9792
|
| |
|
|
|
|
| |
Also removes dependency on junit.framework.TestCase .
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
This patch adds an API to Binding for accessing the validation status handlers from a custom BinderValidationStatusHandler.
|
|
|
| |
Fixes and improves on PR #9932.
|
| |
|
|
|
| |
Fixes #9427
|
|
|
|
| |
Calling readBean(null) should reset the form state to the initial state
it was in before calling writeBean(bean)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add clear field values #8287
Added functionality to make it possible to clear bound field values manually
or when setting a null bean to binder.
Binder will now clear bound fields for setBean(null) or if using readBean() functionality
when calling the clear() method. Binder.clear() will throw a IllegalStateException if
we have a bound bean.
* MultiSelectionModel MultiSelect should implement emptyValue
* Removing public clear() method and clearing field values only through
setBean(null) and readBean(null) to be consistent and not have
confusing functionality.
* Simplified clearFields() as we don't need to check if field is readOnly
* Document in removeBean JavaDoc that it will also clear the bound fields
if we have a bean the is removed.
* Binder should not have changes after clearing fields.
* Add getEmptyValue as default to MultiSelect.
Multiselect default for empty value should be an empty set.
* Revert "Add getEmptyValue as default to MultiSelect."
This reverts commit 45de8f45c4a1e3e45ab8a0353ab2a48bb4f1be6f.
* Merge branch 'master' into issue/8287_Clear_bound_fields
* Remove override for default implementation.
* Fire status change event on clearFields if we had changes before clearing.
* Formatting.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add isValid to Binder
isValid enables you to check the current validation
status of a given Binder, without firing events or invoking
handlers.
This patch also clarifies the javadocs of StatusChangeEvents'
hasValidationErrors.
* Throw in Binder.isValid if no bean is set and bean validators exist
* Add test cases to BinderTest
|
|
|
| |
Closes #8232
|
|
|
|
| |
* Integrate BeanBinder functionality into Binder
|
| |
|
| |
|
| |
|
|
|
|
|
| |
BindingBinder is API that is used before calling bind()
Binding is API that is used after calling bind()
|
|
|
|
|
|
|
|
|
|
| |
The type parameter is mainly used internally, the only externally facing
use is to define the exact type of Binding.getField. Code that has
access to a typed instance of Binding does typically also have direct
access to the field instance, so there's no real use for the type
parameter.
Change-Id: Idf2ab18a79ec5f0a7cef83705b8084fbf7014c10
|
|
|
|
|
|
|
|
|
| |
Unbound binder now correctly sets hasChanges and sends binder
status change events. In addition, hasChanges no longer returns
true in the case where a bean is bound and changes to the bean
were valid.
Change-Id: Ia0a0915c2a205461a2a4b1bfd393413520f863eb
|
|
|
|
|
|
|
|
|
|
| |
Shorthand for making field show required indicator and validating against empty.
Removes obsolete NotNullValidator and NotEmptyValidator. Latter is still used
in some tests, that why it is still in test packages.
Fixes vaadin/framework8-issues#29
Change-Id: Ib116739a20a0bbd1b1460423ee36ed2752c5496a
|
|
|
|
|
|
|
|
|
|
|
| |
save -> writeBean, saveIfValid -> writeBeanIfValid,
load -> readBean, bind -> setBean, unbind -> removeBean.
Now setBean accepts null to reset the bean instead of throwing NPE.
Closes vaadin/framework8-issues#91
Change-Id: I42cbad5856cac11a03bfcefd0fa91a02c41b7234
|
|
|
|
|
|
| |
Fixes vaadin/framework8-issues/#404
Change-Id: I9e07a7de5f67bbd7a5a59cf10cc1a8579cdfbbad
|
|
|
|
| |
Change-Id: If40bfa28764d1399b5ed4d5928988560e9989dce
|
|
|
|
|
|
| |
This reverts commit 9f672890c143098b266ede6397e89379a38cc098.
Change-Id: I0952a7f9c7efc8a5d7de9987277b835d92d52b39
|
|
|
|
| |
Change-Id: I1325c629da220317506306fe8f6fff5c0494d9d9
|
|
|
|
| |
Change-Id: I7c1a55bd68097819e8091533df7232271af689c3
|
|
|
|
|
|
|
| |
Otherwise any validation triggered by field value changes listeners
would cause errors to be visible after loading a new bean.
Change-Id: I741529f491ae6b36ff2a9aa4326c394cc12fb320
|