Class SliderValueBinding<V>
- Type Parameters:
V- the value type
- All Implemented Interfaces:
JmixBinding,SuspendableBinding,ValueBinding<V>
ValueBinding for working with slider components.
A slider cannot represent an absent value and falls back to its minimum value, so the fallback is not propagated to the value source.
-
Field Summary
FieldsFields inherited from class io.jmix.flowui.data.binding.impl.AbstractValueBinding
accessManager, applicationContext, component, componentValueChangeRegistration, messageTools, metadataTools, suspended, validationProviders, validator, valueSource, valueSourceInstanceChangeRegistration, valueSourceStateChangeRegistration, valueSourceValueChangeRegistration -
Constructor Summary
ConstructorsConstructorDescriptionSliderValueBinding(ValueSource<V> valueSource, com.vaadin.flow.component.HasValue<?, V> component) -
Method Summary
Modifier and TypeMethodDescriptionvoidclearValue(Runnable clearComponentValueAction) Clears the value of the component and of the value source.protected @Nullable Vprotected voidprotected voidsetComponentValue(@Nullable V value) voidsetComponentValueSetHandler(@Nullable Runnable componentValueSetHandler) Sets a handler invoked after a value source value has been set to the component.voidWrites the current component value to the value source.Methods inherited from class io.jmix.flowui.data.binding.impl.AbstractValueBinding
activate, addComponentValueChangeListener, bind, getComponent, getValueSource, initBeanValidator, initCustomValidators, initRequired, onValueSourceInstanceChanged, onValueSourceStateChanged, onValueSourceValueChange, resetRequiredIfAttributeFiltered, resume, setAccessManager, setApplicationContext, setMessageTools, setMetadataTools, setValidationProviders, setValidator, setValueToSource, suspend, suspended, unbind
-
Field Details
-
componentValueSetHandler
-
-
Constructor Details
-
SliderValueBinding
public SliderValueBinding(ValueSource<V> valueSource, com.vaadin.flow.component.HasValue<?, V> component)
-
-
Method Details
-
setComponentValueSetHandler
Sets a handler invoked after a value source value has been set to the component.The component substitutes an absent value with its minimum value, so a value source value can change the empty state of the component without changing the component value, i.e. without firing a value change event.
- Parameters:
componentValueSetHandler- the handler to set, ornullto remove it
-
onComponentValueChange
protected void onComponentValueChange()- Overrides:
onComponentValueChangein classAbstractValueBinding<V>
-
writeComponentValueToSource
public void writeComponentValueToSource()Writes the current component value to the value source.The component cannot represent an absent value and shows its minimum value instead, so setting the value the component already shows fires no value change event, and the binding has nothing to react to, although the value source value becomes present.
-
clearValue
Clears the value of the component and of the value source.The component cannot represent an absent value and falls back to its minimum value, so the propagation to the value source is suspended while the component is being cleared and the value source receives
nullinstead of that fallback.- Parameters:
clearComponentValueAction- action that clears the component value
-
getComponentValue
- Specified by:
getComponentValuein classAbstractValueBinding<V>
-
setComponentValue
- Specified by:
setComponentValuein classAbstractValueBinding<V>
-