Class PropertyOutput<T>
java.lang.Object
com.vaadin.flow.component.trigger.AbstractOutput<T>
com.vaadin.flow.component.trigger.PropertyOutput<T>
- Type Parameters:
T- the runtime type of the value produced
- All Implemented Interfaces:
Output<T>,Serializable
Reads a JavaScript property from a target element at the moment a trigger
fires.
Common targets and properties:
TextField.value→new PropertyOutput<>(textField, "value", String.class)Checkbox.checked→new PropertyOutput<>(checkbox, "checked", Boolean.class)
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPropertyOutput(Component target, String propertyName, Class<T> valueType) Creates a property output that reads the given JS property from the given target component's root element.PropertyOutput(Element target, String propertyName, Class<T> valueType) Creates a property output that reads the given JS property from the given target element. -
Method Summary
Modifier and TypeMethodDescriptiontools.jackson.databind.node.ObjectNodebuildClientConfig(ConfigContext context) Produces the JSON configuration this output sends to the client.Methods inherited from class com.vaadin.flow.component.trigger.AbstractOutput
getTypeId, getValueType
-
Field Details
-
TYPE_ID
- See Also:
-
-
Constructor Details
-
PropertyOutput
Creates a property output that reads the given JS property from the given target element.- Parameters:
target- the element to read from, notnullpropertyName- the JS property name, notnullvalueType- runtime type of the produced value, notnull
-
PropertyOutput
Creates a property output that reads the given JS property from the given target component's root element.- Parameters:
target- the component to read from, notnullpropertyName- the JS property name, notnullvalueType- runtime type of the produced value, notnull
-
-
Method Details
-
getTarget
- Returns:
- the target element
-
getPropertyName
- Returns:
- the property name being read
-
buildClientConfig
Description copied from class:AbstractOutputProduces the JSON configuration this output sends to the client. Default is an empty object; override to add type-specific options.Subclasses encode 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:
buildClientConfigin classAbstractOutput<T>- Parameters:
context- the resolver for referenced elements, notnull- Returns:
- a Jackson
ObjectNode, nevernull
-