Skip to content

Binder: Reacting to validation status changes #23300

@tltv

Description

@tltv

Binder should provide a readonly signal that contains the latest BinderValidationStatus state. The signal value should be updated whenever a BinderValidationStatusHandler would have been notified. This should work the same regardless of whether a status handler is explicitly configured or if the default that delegates to handleBinderValidationStatus is in use.

Binder<MyBean> binder = ...;
Signal<BinderValidationStatus<MyBean>> validationStatusSignal = binder.getValidationStatus();
submitButton.bindEnabled(() -> validationStatusSignal.value().isOk());

We won't add API for getting the validation state of only a specific binding as a signal. That's yet again a topic to consider when designing a new signal-native form binding solution.

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions