Interface ValueBinding<V>

Type Parameters:
V - type of value
All Superinterfaces:
Binding
All Known Implementing Classes:
ValueBinder.ValueBindingImpl

public interface ValueBinding<V> extends Binding
Object that holds data binding information for HasValue UI component.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Activates value binding - reads value from source to UI component if state is BindingState.ACTIVE.
    void
    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
    Updates all changes since the previous write to the value source.

    Methods inherited from interface io.jmix.ui.component.data.Binding

    unbind
  • Method Details

    • getSource

      ValueSource<V> getSource()
    • getComponent

      HasValue<V> getComponent()
    • activate

      void activate()
      Activates value binding - reads value from source to UI component if state is BindingState.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. Calling 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 write() and 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.

      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.