Class ServerCallbackAction

java.lang.Object
com.vaadin.flow.component.trigger.AbstractAction
com.vaadin.flow.component.trigger.internal.ServerCallbackAction
All Implemented Interfaces:
Action, Serializable

public final class ServerCallbackAction extends AbstractAction
Action that runs a server-side SerializableRunnable when its trigger fires. Used by Trigger.triggers(SerializableRunnable).

On the client, the flow:server-callback factory's run() simply notifies the server via the per-host return channel; the server's TriggerSupport.dispatchMirror then invokes applyServerSideEffect() which calls the wrapped runnable on the UI thread.

For internal use only.

See Also:
  • Field Details

  • Constructor Details

    • ServerCallbackAction

      public ServerCallbackAction(SerializableRunnable handler)
      Parameters:
      handler - the server-side handler, not null
  • Method Details

    • getHandler

      public SerializableRunnable getHandler()
      Returns:
      the wrapped handler
    • applyServerSideEffect

      public void applyServerSideEffect()
      Description copied from class: AbstractAction
      Mirrors the client-side effect on the server. Called on the UI thread, at the start of the same server cycle that processes the triggering DOM event, before any user-attached event listeners run, so that listener code observes the post-action state.

      Default is a no-op. Subclasses with a server-observable effect (e.g. SetEnabledAction) override this.

      Overrides:
      applyServerSideEffect in class AbstractAction