docs: CRUD editor example with Binder and signal-based UI state management#5313
Open
docs: CRUD editor example with Binder and signal-based UI state management#5313
Conversation
…ement Fixes #5075 - Introduce `CrudEditorExample` demonstrating reactive CRUD functionality using signals, binder integration, and effects - Add a guide article to UI state examples documentation
tltv
reviewed
Mar 9, 2026
| We use [methodname]`Binder::readBean(bean)` to update the form data using | ||
| a signal. This is the preferred approach. | ||
|
|
||
| Avoid using [methodname]`Binder::setBean(beanInstance)` with signals, as this |
Member
There was a problem hiding this comment.
Maybe this could be reformed in such way that users should be aware of setBean meaning unbuffered binder, and changes to the bean are directly reflected to the signal value. This may be wanted in some use case, but usage of buffered binder with readBean (or readRecord for some other use case) is used for the explained reason in this example and it's recommended in this case when form fields are bound to signals.
tltv
requested changes
Apr 2, 2026
Comment on lines
+85
to
+94
| We use [methodname]`Binder::readBean(bean)` to update the form data using | ||
| a signal. This is the preferred approach. | ||
|
|
||
| Avoid using [methodname]`Binder::setBean(beanInstance)` with signals, as this | ||
| enables the binder to change the bean properties directly using setter methods. | ||
| Such changes are not detected by signals. | ||
|
|
||
| To update the signal with the changes from the binder, | ||
| use [methodname]`Binder::writeBean(bean)` combined with the `signal.set(bean)`, | ||
| see the example below. |
Member
There was a problem hiding this comment.
Suggested change
| We use [methodname]`Binder::readBean(bean)` to update the form data using | |
| a signal. This is the preferred approach. | |
| Avoid using [methodname]`Binder::setBean(beanInstance)` with signals, as this | |
| enables the binder to change the bean properties directly using setter methods. | |
| Such changes are not detected by signals. | |
| To update the signal with the changes from the binder, | |
| use [methodname]`Binder::writeBean(bean)` combined with the `signal.set(bean)`, | |
| see the example below. | |
| This example uses [methodname]`Binder::readBean(bean)`, which copies the bean's | |
| property values into the form fields. Changes in the fields are held by the | |
| binder and only written back when you explicitly call | |
| [methodname]`Binder::writeBean(bean)`. This is the recommended approach when | |
| form fields bind to signals, because it gives you full control over when the | |
| signal value is updated (see the save example below). | |
| Using [methodname]`Binder::setBean(bean)` instead binds the form fields | |
| directly to the bean instance. Every field edit is written to the bean | |
| immediately via its setter methods. Those direct mutations are not detected by | |
| signals, so the signal value can change without triggering reactive updates. | |
| This may suit scenarios where immediate write-through is desired, but in most | |
| cases [methodname]`readBean` combined with [methodname]`writeBean` is | |
| preferred. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5075
CrudEditorExampledemonstrating reactive CRUD functionality using signals, binder integration, and effects