Class PropertyInput<T>

java.lang.Object
com.vaadin.flow.component.trigger.internal.Action.Input<T>
com.vaadin.flow.component.trigger.internal.PropertyInput<T>
Type Parameters:
T - the runtime type of the value produced
All Implemented Interfaces:
Serializable

public class PropertyInput<T> extends Action.Input<T>
Reads a JavaScript property from a target component's root element at the moment a trigger fires.

Common targets and properties:

  • TextField.valuenew PropertyInput<>(textField, "value", String.class)
  • Checkbox.checkednew PropertyInput<>(checkbox, "checked", Boolean.class)

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

See Also:
  • Constructor Details

    • PropertyInput

      public PropertyInput(Component target, String propertyName, Class<T> valueType)
      Creates a property input that reads the given JS property from the given target component.
      Parameters:
      target - the component to read from, not null
      propertyName - the JS property name, not null
      valueType - runtime type of the produced value, not null
  • Method Details

    • toJs

      protected JsFunction toJs(Trigger trigger)
      Description copied from class: Action.Input
      Builds the JsFunction that yields this input's value when called. The function may take event as a runtime argument (declared by the subclass via JsFunction.withArguments(String...)); inputs that don't need event simply omit the declaration and ignore the argument the caller passes.
      Specified by:
      toJs in class Action.Input<T>
      Parameters:
      trigger - the surrounding trigger this render is for, not null
      Returns:
      the input's JS function, not null