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

protected static class ValueBinder.ValueBindingImpl<V> extends Object implements ValueBinding<V>
  • Field Details

    • source

      protected ValueSource<V> source
    • component

      protected HasValue<V> component
    • componentValueChangeSubscription

      protected Subscription componentValueChangeSubscription
    • sourceValueChangeSubscription

      protected Subscription sourceValueChangeSubscription
    • sourceStateChangeSubscription

      protected Subscription sourceStateChangeSubscription
    • sourceInstanceChangeSubscription

      protected Subscription sourceInstanceChangeSubscription
    • buffered

      protected boolean buffered
  • Constructor Details

  • Method Details

    • getSource

      public ValueSource<V> getSource()
      Specified by:
      getSource in interface ValueBinding<V>
    • getComponent

      public HasValue<V> getComponent()
      Specified by:
      getComponent in interface ValueBinding<V>
    • unbind

      public void unbind()
      Description copied from interface: Binding
      Destroy data binding.
      Specified by:
      unbind in interface Binding
    • activate

      public void activate()
      Description copied from interface: ValueBinding
      Activates value binding - reads value from source to UI component if state is BindingState.ACTIVE.
      Specified by:
      activate in interface ValueBinding<V>
    • disableBeanValidator

      protected void disableBeanValidator(Field<?> component)
    • 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 interface ValueBinding<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 interface ValueBinding<V>
    • isBuffered

      public boolean isBuffered()
      Specified by:
      isBuffered in interface ValueBinding<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. Calling ValueBinding.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() and ValueBinding.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 interface ValueBinding<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 interface ValueBinding<V>
      Returns:
      true if the value in the component has been modified since the last value source update, false if not.
    • valueSourceStateChanged

      protected void valueSourceStateChanged(DataUnit.StateChangeEvent event)
    • componentValueChanged

      protected void componentValueChanged(HasValue.ValueChangeEvent event)
    • setValueToSource

      protected void setValueToSource(V value)
    • sourceValueChanged

      protected void sourceValueChanged(ValueSource.ValueChangeEvent<V> event)
    • sourceInstanceChanged

      protected void sourceInstanceChanged(EntityValueSource.InstanceChangeEvent<Object> event)
    • 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.