Class ClickAction

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

public class ClickAction extends AbstractAction
Calls target.click() on a target element, dispatching a synthetic click event. Typically used to chain a trigger onto another component's click handling — for example, a shortcut that fires the same path as a button press.
See Also:
  • Field Details

  • Constructor Details

    • ClickAction

      public ClickAction(Element target)
      Creates a click action that clicks the given target element.
      Parameters:
      target - the element to click, not null
    • ClickAction

      public ClickAction(Component target)
      Creates a click action that clicks the given target component's root element.
      Parameters:
      target - the component to click, not null
  • Method Details

    • getTarget

      public Element getTarget()
      Returns:
      the target element
    • buildClientConfig

      public tools.jackson.databind.node.ObjectNode buildClientConfig(ConfigContext context)
      Description copied from class: AbstractAction
      Produces the JSON configuration this action sends to the client. Default is an empty object; override to add type-specific options.

      Subclasses encode output references by calling ConfigContext.registerOutput(Output) and element references by calling ConfigContext.referenceElement(com.vaadin.flow.dom.Element). Public so the internal framework can read the config without reflection; subclasses just override.

      Overrides:
      buildClientConfig in class AbstractAction
      Parameters:
      context - the resolver for referenced elements and outputs, not null
      Returns:
      a Jackson ObjectNode, never null