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

fix: Ensure that side effects of readBean does not set hasChanges true #12455

Merged
merged 2 commits into from
Oct 27, 2021

Conversation

TatuLund
Copy link
Contributor

@TatuLund TatuLund commented Oct 27, 2021

JavaDoc of hasChanges says

"Check whether any of the bound fields' have uncommitted changes since last explicit call to {@link #readBean(Object)}, {@link #removeBean()}, * {@link #writeBean(Object)} or {@link #writeBeanIfValid(Object)}."

If readBean has converters, they will be run and field values updated accordingly. Furthermore if fields have value change listeners that will produce further changes in values, this should be considered according to above as part of readBean producedure and thus hasChanges still should return false.

fixes: #9581

@TatuLund TatuLund changed the title Test fix: Ensure that side effects of readBean does not set hasChanges true Oct 27, 2021
@Ansku Ansku merged commit 51d403f into master Oct 27, 2021
@Ansku Ansku deleted the binder-haschanges branch October 27, 2021 10:18
@TatuLund TatuLund added this to the 8.14.2 milestone Oct 29, 2021
Ansku added a commit that referenced this pull request Oct 29, 2021
anssit pushed a commit to vaadin/flow that referenced this pull request Nov 9, 2021
…12181)

JavaDoc of hasChanges says:

"Check whether any of the bound fields' have uncommitted changes
since last explicit call to readBean(Object), removeBean(), writeBean(Object)}
or writeBeanIfValid(Object)."

If readBean has converters, they will be run and field values updated accordingly.
Furthermore if fields have value change listeners that will produce further
changes in values, this should be considered according to above as part of
readBean procedure and thus hasChanges still should return false.

Cherry pick from: vaadin/framework#12455
anssit pushed a commit to vaadin/flow that referenced this pull request Nov 9, 2021
…12181)

JavaDoc of hasChanges says:

"Check whether any of the bound fields' have uncommitted changes
since last explicit call to readBean(Object), removeBean(), writeBean(Object)}
or writeBeanIfValid(Object)."

If readBean has converters, they will be run and field values updated accordingly.
Furthermore if fields have value change listeners that will produce further
changes in values, this should be considered according to above as part of
readBean procedure and thus hasChanges still should return false.

Cherry pick from: vaadin/framework#12455

(cherry picked from commit 4e36fd9)
joheriks pushed a commit to vaadin/flow that referenced this pull request Nov 9, 2021
…12181) (#12317)

JavaDoc of hasChanges says:

"Check whether any of the bound fields' have uncommitted changes
since last explicit call to readBean(Object), removeBean(), writeBean(Object)}
or writeBeanIfValid(Object)."

If readBean has converters, they will be run and field values updated accordingly.
Furthermore if fields have value change listeners that will produce further
changes in values, this should be considered according to above as part of
readBean procedure and thus hasChanges still should return false.

Cherry pick from: vaadin/framework#12455

(cherry picked from commit 4e36fd9)

Co-authored-by: Tatu Lund <tatu@vaadin.com>
anssit pushed a commit to vaadin/flow that referenced this pull request Nov 9, 2021
…12181)

JavaDoc of hasChanges says:

"Check whether any of the bound fields' have uncommitted changes
since last explicit call to readBean(Object), removeBean(), writeBean(Object)}
or writeBeanIfValid(Object)."

If readBean has converters, they will be run and field values updated accordingly.
Furthermore if fields have value change listeners that will produce further
changes in values, this should be considered according to above as part of
readBean procedure and thus hasChanges still should return false.

Cherry pick from: vaadin/framework#12455

(cherry picked from commit 4e36fd9)
joheriks pushed a commit to vaadin/flow that referenced this pull request Nov 9, 2021
…12181) (#12319)

JavaDoc of hasChanges says:

"Check whether any of the bound fields' have uncommitted changes
since last explicit call to readBean(Object), removeBean(), writeBean(Object)}
or writeBeanIfValid(Object)."

If readBean has converters, they will be run and field values updated accordingly.
Furthermore if fields have value change listeners that will produce further
changes in values, this should be considered according to above as part of
readBean procedure and thus hasChanges still should return false.

Cherry pick from: vaadin/framework#12455

(cherry picked from commit 4e36fd9)

Co-authored-by: Tatu Lund <tatu@vaadin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Binder.hasChanges set to true after Binder.readBean
2 participants