T - Value typepublic interface ValidatableInput<T> extends Input<T>, Validatable
Input component with validation support using Validators.Input.InputPropertyRenderer<T>, Input.InputValueConversionException, Input.PropertyHandler<P,T,V extends com.vaadin.flow.component.HasValue<?,T>,C extends com.vaadin.flow.component.Component>ValueHolder.ValueChangeEvent<V>, ValueHolder.ValueChangeListener<V,E extends ValueHolder.ValueChangeEvent<V>>| Modifier and Type | Method and Description |
|---|---|
com.holonplatform.core.Registration |
addValidator(com.holonplatform.core.Validator<T> validator)
Adds a
Validator to validate the input value. |
static <T> ValidatableInputBuilder<T> |
builder(Input<T> input)
Get a fluent builder to create and setup a
ValidatableInput from given Input. |
static <T> ValidatableInput<T> |
create(com.holonplatform.core.property.Property<T> property)
Get a
ValidatableInput component to handle the value of given property. |
static <T> Optional<ValidatableInput<T>> |
forProperty(com.holonplatform.core.property.Property<T> property)
Try to obtain a
ValidatableInput component to handle the value of given property. |
static <F extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasValue<?,T>,T> |
from(F field)
Create a
ValidatableInput component type from given HasValue component. |
static <T> ValidatableInput<T> |
from(Input<T> input)
Create a
ValidatableInput from given Input instance. |
Optional<ValidationStatusHandler<ValidatableInput<T>>> |
getValidationStatusHandler()
Get the
ValidationStatusHandler to use to track validation status changes, if available. |
T |
getValue()
Get the input value.
|
boolean |
isValidateOnValueChange()
Gets whether to validate the value, using registered
Validators, every time the Input value
changes. |
void |
setValidateOnValueChange(boolean validateOnValueChange)
Sets whether to validate the value, using registered
Validators, every time the Input value
changes. |
void |
setValidationStatusHandler(ValidationStatusHandler<ValidatableInput<T>> validationStatusHandler)
Set the
ValidationStatusHandler to use to track validation status changes. |
asHasValue, boolean_, builder, create, date, dateTime, enumMultiSelect, enumOptionSelect, enumSelect, focus, from, from, from, from, hasInvalidChangeEventNotifier, hasPlaceholder, hasTitle, isReadOnly, isRequired, localDate, localDateTime, localTime, multiOptionSelect, multiOptionSelect, multiOptionSelect, multiOptionSelect, number, password, setReadOnly, setRequired, singleOptionSelect, singleOptionSelect, singleOptionSelect, singleOptionSelect, singleSelect, singleSelect, singleSelect, singleSelect, singleSimpleSelect, singleSimpleSelect, singleSimpleSelect, singleSimpleSelect, string, stringAreaaddValueChangeListener, clear, getEmptyValue, getValueIfPresent, isEmpty, setValuehasValueChangeModecreate, getComponent, getElement, hasEnabled, hasLabel, hasSize, hasStyle, hasValidation, isVisible, setVisibleT getValue()
The value is validated using the registered Validators, if any, and a Validator.ValidationException is
thrown if any validator fail.
getValue in interface ValueComponent<T>getValue in interface ValueHolder<T,ValueHolder.ValueChangeEvent<T>>com.holonplatform.core.Validator.ValidationException - If validation failscom.holonplatform.core.Registration addValidator(com.holonplatform.core.Validator<T> validator)
Validator to validate the input value.validator - The validator to add (not null)void setValidateOnValueChange(boolean validateOnValueChange)
Validators, every time the Input value
changes.validateOnValueChange - true to perform value validation every time the Input value
changes, false if notboolean isValidateOnValueChange()
Validators, every time the Input value
changes.true if the value validation must be performed every time the Input value changesvoid setValidationStatusHandler(ValidationStatusHandler<ValidatableInput<T>> validationStatusHandler)
ValidationStatusHandler to use to track validation status changes.validationStatusHandler - the ValidationStatusHandler to setOptional<ValidationStatusHandler<ValidatableInput<T>>> getValidationStatusHandler()
ValidationStatusHandler to use to track validation status changes, if available.ValidationStatusHandlerstatic <T> ValidatableInput<T> from(Input<T> input)
ValidatableInput from given Input instance.from in interface Input<T>T - Value typeinput - The Input instance (not null)ValidatableInput component which wraps the given inputstatic <F extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasValue<?,T>,T> ValidatableInput<T> from(F field)
ValidatableInput component type from given HasValue component.from in interface Input<T>T - Value typeF - HasValue component typefield - The field instance (not null)ValidatableInput component which wraps the given fieldstatic <T> ValidatableInputBuilder<T> builder(Input<T> input)
ValidatableInput from given Input.builder in interface Input<T>T - Value typeinput - Concrete input component (not null)ValidatableInput builderstatic <T> Optional<ValidatableInput<T>> forProperty(com.holonplatform.core.property.Property<T> property)
ValidatableInput component to handle the value of given property.
The current PropertyRendererRegistry is used to look for a suitable PropertyRenderer to render
the ValidatableInput using the provided Property.
T - Property typeproperty - The property for which to obtain the ValidatableInput (not null)ValidatableInput componentPropertyRendererRegistry.get()static <T> ValidatableInput<T> create(com.holonplatform.core.property.Property<T> property)
ValidatableInput component to handle the value of given property.
The current PropertyRendererRegistry is used to look for a suitable PropertyRenderer to render
the ValidatableInput using the provided Property.
create in interface Input<T>T - Property typeproperty - The property for which to obtain the ValidatableInput (not null)ValidatableInput componentcom.holonplatform.core.property.PropertyRendererRegistry.NoSuitableRendererAvailableException - If a suitable PropertyRenderer is not available to render given
property as a ValidatableInputPropertyRendererRegistry.get()Copyright © 2019 The Holon Platform. All rights reserved.