Package io.jmix.ui.component.data.meta
Interface ValueBinding<V>
- Type Parameters:
V
- type of value
- All Superinterfaces:
Binding
- All Known Implementing Classes:
ValueBinder.ValueBindingImpl
Object that holds data binding information for
HasValue
UI component.-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Activates value binding - reads value from source to UI component if state isBindingState.ACTIVE
.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.void
setBuffered
(boolean buffered) Sets the buffered mode.void
write()
Updates all changes since the previous write to the value source.
-
Method Details
-
getSource
ValueSource<V> getSource() -
getComponent
-
activate
void activate()Activates value binding - reads value from source to UI component if state isBindingState.ACTIVE
. -
write
void write()Updates all changes since the previous write to the value source. -
discard
void discard()Discards all changes since last write. The component updates its value from the value source. -
isBuffered
boolean isBuffered()- Returns:
true
if the buffered mode is on,false
otherwise
-
setBuffered
void setBuffered(boolean buffered) Sets the buffered mode.When in buffered mode, the component value changes will not be reflected in value source until
write()
is called. Callingdiscard()
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
write()
anddiscard()
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.
- Parameters:
buffered
-true
if the buffered mode should be turned on,false
otherwise
-
isModified
boolean isModified()Tests if the value stored in the component has been modified since it was last updated from the value source.- Returns:
true
if the value in the component has been modified since the last value source update,false
if not.
-