Class HasClientValidation.ClientValidatedEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<com.vaadin.flow.component.Component>
com.vaadin.flow.component.shared.HasClientValidation.ClientValidatedEvent
All Implemented Interfaces:
Serializable
Enclosing interface:
HasClientValidation

@DomEvent("validated") public static class HasClientValidation.ClientValidatedEvent extends com.vaadin.flow.component.ComponentEvent<com.vaadin.flow.component.Component>
An event fired by the web component whenever it is validated on the client-side.
See Also:
  • Field Summary

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    ClientValidatedEvent(com.vaadin.flow.component.Component source, boolean fromClient)
    Creates a new event using the given source.
    ClientValidatedEvent(com.vaadin.flow.component.Component source, boolean fromClient, boolean valid)
    Creates a new event using the given source.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns true if the client-side validation succeeded and false otherwise.

    Methods inherited from class com.vaadin.flow.component.ComponentEvent

    getSource, isFromClient, unregisterListener

    Methods inherited from class java.util.EventObject

    toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ClientValidatedEvent

      public ClientValidatedEvent(com.vaadin.flow.component.Component source, boolean fromClient, @EventData("event.detail.valid") boolean valid)
      Creates a new event using the given source.
      Parameters:
      source - the source component.
      fromClient - true if the event originated from the client side, false otherwise
      valid - whether the client-side validation succeeded.
    • ClientValidatedEvent

      public ClientValidatedEvent(com.vaadin.flow.component.Component source, boolean fromClient)
      Creates a new event using the given source. This constructor should be used when creating the event on the server-side.
      Parameters:
      source - the source component.
      fromClient - true if the event originated from the client side, false otherwise
  • Method Details

    • isValid

      public Boolean isValid()
      Returns true if the client-side validation succeeded and false otherwise.

      Note, this method will always return true if the event originated from the server-side i.e. ComponentEvent.isFromClient() returns false.

      Returns:
      whether the client-side validation succeeded.