Class SetSignalAction<T>
java.lang.Object
com.vaadin.flow.component.trigger.internal.Action
com.vaadin.flow.component.trigger.internal.CallbackAction<T>
com.vaadin.flow.component.trigger.internal.SetSignalAction<T>
- Type Parameters:
T- the type the signal holds and the JSON value is decoded to
- All Implemented Interfaces:
Serializable
Named
CallbackAction that calls set on a ValueSignal
— the common case of bridging a client-side trigger into server-side signal
state. For other server-side destinations (logging, custom events, queues, …)
use CallbackAction directly with a method reference.
ValueSignal<String> valueSignal = new ValueSignal<>("");
DomEventTrigger input = new DomEventTrigger(textField, "input");
input.triggers(new SetSignalAction<>(valueSignal, String.class,
new PropertyInput<>(textField, "value", String.class)));
The signal's own equality checker debounces redundant updates, so emitting identical values back-to-back does not retrigger downstream effects.
For internal use only. May be renamed or removed in a future release.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.trigger.internal.Action
Action.Input<T> -
Constructor Summary
ConstructorsConstructorDescriptionSetSignalAction(ValueSignal<? super T> signal, Class<T> valueType, Action.Input<? extends T> source) Creates an action that, when the trigger fires, evaluatessourceon the client, sends the value to the server, decodes it asvalueType, and assigns it tosignalviaValueSignal.set(Object). -
Method Summary
Methods inherited from class com.vaadin.flow.component.trigger.internal.CallbackAction
toJsMethods inherited from class com.vaadin.flow.component.trigger.internal.Action
warnIfNotVisible
-
Constructor Details
-
SetSignalAction
public SetSignalAction(ValueSignal<? super T> signal, Class<T> valueType, Action.Input<? extends T> source) Creates an action that, when the trigger fires, evaluatessourceon the client, sends the value to the server, decodes it asvalueType, and assigns it tosignalviaValueSignal.set(Object).- Parameters:
signal- the local value signal to update on the server, notnullvalueType- runtime type the JSON value is decoded to before being passed toValueSignal.set(Object), notnullsource- input that produces the value on the client when the trigger fires, notnull
-