Skip to content

feat: Add Binder.refreshFields() - #13535

Merged
taefi merged 7 commits into
masterfrom
binder-update-fields
Apr 27, 2022
Merged

taefi merged 7 commits into
masterfrom
binder-update-fields

Conversation

@tarekoraby

@tarekoraby tarekoraby commented Apr 13, 2022 •

Copy link
Copy Markdown
Contributor

In situations when a bean foo that is bound to a binder has one its properties changed on the server-side, one currently needs to reset the binding to that bean in order for the new property value to be reflected on the fields.

So if I have

binder.setBean(foo);
foo.setBar(new Bar());

Then I would need to call binder.setBean(foo) again for the value to be reflected on the field associated with the property bar.

This usage is, however, not obvious to the user as what they want to do is only update the fields associated with the binder in order for them to reflect the updated state of the bean. (plus there is a very minor wastefulness in calling binder.setBean(foo) again as that removes the same bean only to add it again).

This PR adds a Binder.refreshFields() API to match the intention of the user in those use cases.

@github-actions

github-actions Bot commented Apr 13, 2022 •

Copy link
Copy Markdown
Contributor

Unit Test Results

   960 files  +1     960 suites  +1   51m 56s ⏱️ +29s
6 222 tests +6  6 173 ✔️ +6  49 💤 ±0  0 ❌ ±0 
6 449 runs  +6  6 394 ✔️ +6  55 💤 ±0  0 ❌ ±0 

Results for commit f473358. ± Comparison against base commit 26277ce.

♻️ This comment has been updated with latest results.

@tarekoraby tarekoraby changed the title feat: Add Binder.updateFields() feat: Add Binder.refreshFields() Apr 14, 2022
tarekoraby and others added 2 commits April 19, 2022 13:14
Co-authored-by: Soroosh Taefi <taefi.soroosh@gmail.com>
@mshabarov

Copy link
Copy Markdown
Contributor

@tarekoraby please merge current master to your branch

@vaadin-bot vaadin-bot added +1.0.0 and removed +0.1.0 labels Apr 26, 2022
@taefi
taefi requested a review from mshabarov April 26, 2022 17:12
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@taefi taefi added +0.1.0 and removed +1.0.0 labels Apr 27, 2022
@mshabarov
mshabarov requested a review from taefi April 27, 2022 10:44
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 23.1.0.alpha4 and is also targeting the upcoming stable 23.1.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants