Class FieldValueChangeEvent

java.lang.Object
com.vaadin.flow.component.ai.form.FieldValueChangeEvent
All Implemented Interfaces:
Serializable

public final class FieldValueChangeEvent extends Object implements 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 Details

    • getSource

      public FormAIController 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 null on an event restored from a serialized session.

      Returns:
      the source controller, or null if 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

      public Object 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 than null. For a field added to the form during the turn, this is the field's empty value — the field had no pre-turn value to report.
      Returns:
      the pre-turn value, possibly null
    • getNewValue

      public Object 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