Interface ClientActionSink

All Superinterfaces:
Serializable
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ClientActionSink extends Serializable
Receives the client-side function an Action renders to when it is bound through a SinkTrigger, and is responsible for getting it invoked in the browser.

Implemented by whatever accepts client actions — typically a renderer that passes the function into its own client-side template so a @click binding can call it. The function takes (event, context): the client event that fired it, if any, and {args}, the arguments the template called the action with. Clipboard.writeText(), for example, copies args[0].

For internal use only. May be renamed or removed in a future release.

  • Method Summary

    Modifier and Type
    Method
    Description
    Takes the rendered action function and arranges for it to be called on the client.
  • Method Details

    • install

      Registration install(JsFunction action)
      Takes the rendered action function and arranges for it to be called on the client.
      Parameters:
      action - the action function, to be invoked as action(event, context), not null
      Returns:
      a registration that undoes the installation, never null