Package io.jmix.ui.component.data.value
Class ValueBinder.ValueBindingImpl<V>
java.lang.Object
io.jmix.ui.component.data.value.ValueBinder.ValueBindingImpl<V>
- All Implemented Interfaces:
Binding,ValueBinding<V>
- Enclosing class:
- ValueBinder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Subscriptionprotected ValueSource<V>protected Subscriptionprotected Subscriptionprotected Subscription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates value binding - reads value from source to UI component if state isBindingState.ACTIVE.voidbind()protected voidprotected voiddisableBeanValidator(Field<?> component) voiddiscard()Discards all changes since last write.booleanbooleanTests if the value stored in the component has been modified since it was last updated from the value source.protected voidresetRequiredIfAttributeFiltered(Field<?> field, EntityValueSource valueSource, MetaPropertyPath metaPropertyPath) Set field's "required" flag to false if the value has been filtered by Row Level Security.voidsetBuffered(boolean buffered) Sets the buffered mode.protected voidsetValueToSource(V value) protected voidprotected voidvoidunbind()Destroy data binding.protected voidvoidwrite()Updates all changes since the previous write to the value source.
-
Field Details
-
source
-
component
-
componentValueChangeSubscription
-
sourceValueChangeSubscription
-
sourceStateChangeSubscription
-
sourceInstanceChangeSubscription
-
buffered
protected boolean buffered
-
-
Constructor Details
-
ValueBindingImpl
-
-
Method Details
-
getSource
- Specified by:
getSourcein interfaceValueBinding<V>
-
getComponent
- Specified by:
getComponentin interfaceValueBinding<V>
-
unbind
public void unbind()Description copied from interface:BindingDestroy data binding. -
activate
public void activate()Description copied from interface:ValueBindingActivates value binding - reads value from source to UI component if state isBindingState.ACTIVE.- Specified by:
activatein interfaceValueBinding<V>
-
disableBeanValidator
-
bind
public void bind() -
write
public void write()Description copied from interface:ValueBindingUpdates all changes since the previous write to the value source.- Specified by:
writein interfaceValueBinding<V>
-
discard
public void discard()Description copied from interface:ValueBindingDiscards all changes since last write. The component updates its value from the value source.- Specified by:
discardin interfaceValueBinding<V>
-
isBuffered
public boolean isBuffered()- Specified by:
isBufferedin interfaceValueBinding<V>- Returns:
trueif the buffered mode is on,falseotherwise
-
setBuffered
public void setBuffered(boolean buffered) Description copied from interface:ValueBindingSets the buffered mode.When in buffered mode, the component value changes will not be reflected in value source until
ValueBinding.write()is called. CallingValueBinding.discard()will revert the components value to the value of the value source.When in non-buffered mode both read and write operations will be done directly on the value source. In this mode the
ValueBinding.write()andValueBinding.discard()methods serve no purpose.If the value in the component has been modified since the last value source update and the buffered mode is switched off at runtime, then the component will update its value from the value source.
- Specified by:
setBufferedin interfaceValueBinding<V>- Parameters:
buffered-trueif the buffered mode should be turned on,falseotherwise
-
isModified
public boolean isModified()Description copied from interface:ValueBindingTests if the value stored in the component has been modified since it was last updated from the value source.- Specified by:
isModifiedin interfaceValueBinding<V>- Returns:
trueif the value in the component has been modified since the last value source update,falseif not.
-
valueSourceStateChanged
-
componentValueChanged
-
setValueToSource
-
sourceValueChanged
-
sourceInstanceChanged
-
resetRequiredIfAttributeFiltered
protected void resetRequiredIfAttributeFiltered(Field<?> field, EntityValueSource valueSource, MetaPropertyPath metaPropertyPath) Set field's "required" flag to false if the value has been filtered by Row Level Security. This is necessary to allow user to submit form with filtered attribute even if attribute is required.
-