Class FieldValueChangeEvent
java.lang.Object
com.vaadin.flow.component.ai.form.FieldValueChangeEvent
- All Implemented Interfaces:
Serializable
Fired by
FormAIController once per field whose value changed during a
successful AI turn — either written by the LLM or by a cascade. Events fire
in document order, after every field's post-turn value has been applied. A
field whose post-turn value equals its pre-turn value (by
Objects.equals(Object, Object)) does not produce an event. No events
fire when the turn ended in error.- Since:
- 25.3
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.component.HasValue<?, ?> getField()Returns the field whose value changed during this turn.Returns the field's value at the end of the turn, after the LLM's writes and any cascading value-change listeners have settled.Returns the field's value at the start of the turn, before the LLM ran.Returns the controller that produced this event.
-
Method Details
-
getSource
Returns the controller that produced this event. Listeners can use this to call back into the controller (e.g.FormAIController.showFieldHighlight(com.vaadin.flow.component.HasValue<?, ?>)) without capturing it from the registration site.The source is transient, so it is
nullon an event restored from a serialized session.- Returns:
- the source controller, or
nullif this event was deserialized
-
getField
public com.vaadin.flow.component.HasValue<?,?> getField()Returns the field whose value changed during this turn.- Returns:
- the changed field, never
null
-
getOldValue
Returns the field's value at the start of the turn, before the LLM ran. For a field that was hidden at turn start and revealed during the turn, this is the field's actual pre-turn value rather thannull. For a field added to the form during the turn, this is the field'sempty value— the field had no pre-turn value to report.- Returns:
- the pre-turn value, possibly
null
-
getNewValue
Returns the field's value at the end of the turn, after the LLM's writes and any cascading value-change listeners have settled.- Returns:
- the post-turn value, possibly
null
-