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
Modifier and TypeFieldDescriptionprotected boolean
protected Subscription
protected ValueSource<V>
protected Subscription
protected Subscription
protected Subscription
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Activates value binding - reads value from source to UI component if state isBindingState.ACTIVE
.void
bind()
protected void
protected void
disableBeanValidator
(Field<?> component) void
discard()
Discards all changes since last write.boolean
boolean
Tests if the value stored in the component has been modified since it was last updated from the value source.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.void
setBuffered
(boolean buffered) Sets the buffered mode.protected void
setValueToSource
(V value) protected void
protected void
void
unbind()
Destroy data binding.protected void
void
write()
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:
getSource
in interfaceValueBinding<V>
-
getComponent
- Specified by:
getComponent
in interfaceValueBinding<V>
-
unbind
public void unbind()Description copied from interface:Binding
Destroy data binding. -
activate
public void activate()Description copied from interface:ValueBinding
Activates value binding - reads value from source to UI component if state isBindingState.ACTIVE
.- Specified by:
activate
in interfaceValueBinding<V>
-
disableBeanValidator
-
bind
public void bind() -
write
public void write()Description copied from interface:ValueBinding
Updates all changes since the previous write to the value source.- Specified by:
write
in interfaceValueBinding<V>
-
discard
public void discard()Description copied from interface:ValueBinding
Discards all changes since last write. The component updates its value from the value source.- Specified by:
discard
in interfaceValueBinding<V>
-
isBuffered
public boolean isBuffered()- Specified by:
isBuffered
in interfaceValueBinding<V>
- Returns:
true
if the buffered mode is on,false
otherwise
-
setBuffered
public void setBuffered(boolean buffered) Description copied from interface:ValueBinding
Sets 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:
setBuffered
in interfaceValueBinding<V>
- Parameters:
buffered
-true
if the buffered mode should be turned on,false
otherwise
-
isModified
public boolean isModified()Description copied from interface:ValueBinding
Tests if the value stored in the component has been modified since it was last updated from the value source.- Specified by:
isModified
in interfaceValueBinding<V>
- Returns:
true
if the value in the component has been modified since the last value source update,false
if 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.
-