New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binder.setBean writes read only fields back to bean #9446
Comments
Hello. I'd say this is how it should go and this is a bug. |
This ticket/PR has been released with platform 20.0.0.alpha8. For prerelease versions, it will be included in its final version. |
This ticket/PR has been released with platform 14.6.0.rc1. For prerelease versions, it will be included in its final version. |
This ticket/PR has been released with platform 14.5.5. For prerelease versions, it will be included in its final version. |
This ticket/PR has been released with platform 19.0.7. For prerelease versions, it will be included in its final version. |
When Binding a field as read only and calling Binder.setBean the current behavior is such that field value gets written back to bean. If field has one-way converter defined this destroys the field value in bean as converter convertToModel is called, which should not happen for read only fields. For example in our case the value is some object and it needs to be converted to String for presentation. However it is not possible to convert value back from String. This kind of scenario should be possible, when defining field binding as read only. In such case only convertToPresentation should be called.
test.zip
Steps to reproduce the behavior:
Expected behavior would be in this case that ExampleBean.vals field would stay intact and won't be null as the field binding is defined as read only.
The text was updated successfully, but these errors were encountered: