Class ClickTrigger
java.lang.Object
com.vaadin.flow.component.trigger.internal.Trigger
com.vaadin.flow.component.trigger.internal.DomEventTrigger
com.vaadin.flow.component.trigger.internal.MouseEventTrigger
com.vaadin.flow.component.trigger.internal.ClickTrigger
- All Implemented Interfaces:
Serializable
Fires on the host component's
click DOM event. The event's
coordinates and modifier-key state are available as static
Action.Input sources on MouseEventTrigger.EventData (also
reachable as ClickTrigger.EventData through inheritance).
Example — on click, mirror the screen coordinates of the click into two input
fields' value properties:
ClickTrigger click = new ClickTrigger(button);
click.triggers(
new SetPropertyAction<>(xField, "value",
ClickTrigger.EventData.screenX),
new SetPropertyAction<>(yField, "value",
ClickTrigger.EventData.screenY));
For internal use only. May be renamed or removed in a future release.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.trigger.internal.MouseEventTrigger
MouseEventTrigger.EventData -
Constructor Summary
ConstructorsConstructorDescriptionClickTrigger(Component host) Creates a click trigger on the given host component's root element. -
Method Summary
Methods inherited from class com.vaadin.flow.component.trigger.internal.DomEventTrigger
install
-
Constructor Details
-
ClickTrigger
Creates a click trigger on the given host component's root element.- Parameters:
host- the component to listen on, notnull
-