Skip to content
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

Grid editor keeps stacking bindings for columns #11722

Closed
gatanaso opened this issue Sep 16, 2019 · 1 comment
Closed

Grid editor keeps stacking bindings for columns #11722

gatanaso opened this issue Sep 16, 2019 · 1 comment
Labels

Comments

@gatanaso
Copy link

gatanaso commented Sep 16, 2019

Description of the bug
Grid doesn't remove the bindings when the related column is removed or a new binding is set for a column. It just keeps stacking bindings, and all their validators are run when the editor validation is run

Minimal reproducible example
This project contains a minimal reproducible example:
grid-editor.zip

With the control buttons, various conflicting bindings can be added for the "first name" column. After adding an additional binding, or removing the column and then adding it again with a new binding, all binders/validators are executed for the column.

Expected behavior
Grid removes the bindings when a related column is removed or if a new binding is set for the column.

Actual behavior
Grid doesn't remove the bindings when the related column is removed or a new binding is set for a column.

Details
Vaadin Framework version 8.9.0 (probably happens in earlier versions as well)

@TatuLund
Copy link
Contributor

Thanks for the report.

This behavior is intentional. Grid has been implemented in the way that Binder is decoupled as much as possible. Grid is using Binder only when populating the Editor, nothing else.

So it is left for application developer to configure the Binder as well as symmetrically dismantling it if needed. e.g. developer can use removeBinding(..) to remove the binding when removing the column.

Also removal and re-adding columns is in most cases un-necessary since you can programmatically hide them too, which is lighter operation. It depends on the application what is more appropriate of course.

TatuLund added a commit that referenced this issue Sep 18, 2019
ZheSun88 pushed a commit that referenced this issue Oct 3, 2019
* Added note in JavaDoc of removeColumn

#11722

* Merge branch 'master' into fix11722

* Merge branch 'master' into fix11722
ZheSun88 pushed a commit that referenced this issue Oct 3, 2019
* Added note in JavaDoc of removeColumn

#11722

* Merge branch 'master' into fix11722

* Merge branch 'master' into fix11722
ZheSun88 pushed a commit that referenced this issue Oct 4, 2019
* Added note in JavaDoc of removeColumn

#11722

* Merge branch 'master' into fix11722

* Merge branch 'master' into fix11722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants