This is the code for an value change observer
439316
def _get_observer_fun(self, prop_name):
        """"""
        def _observer_fun(self, model, old, new):
            if self._itsme:
                return
            self._on_prop_changed()

        # doesn't affect stack traces
        _observer_fun.__name__ = "property_%s_value_change" % prop_name
        return _observer_fun
968785
public void notifyValueChanged (boolean fireEvent) {
		VisValidatableTextField textField = getTextField();
		int cursor = textField.getCursorPosition();
		textField.setCursorPosition(0);
		textField.setText(model.getText());
		textField.setCursorPosition(cursor);

		if (fireEvent) {
			ChangeListener.ChangeEvent changeEvent = Pools.obtain(ChangeListener.ChangeEvent.class);
			fire(changeEvent);
			Pools.free(changeEvent);
		}
	}
183539
function () {
        var i, len;
        checkDisposed(this);
        if (!this.isStopped) {
          this.isStopped = true;
          var os = cloneArray(this.observers), len = os.length;

          if (this.hasValue) {
            for (i = 0; i < len; i++) {
              var o = os[i];
              o.onNext(this.value);
              o.onCompleted();
            }
          } else {
            for (i = 0; i < len; i++) {
              os[i].onCompleted();
            }
          }

          this.observers.length = 0;
        }
      }
397369
function observeStyleChanges (element, stylesToObserve, onChange) {
    var oldStyles = {};

    var getStyle = function getStyle(style) {
      switch (style) {
      case 'width':
        return $(element).width();

      case 'height':
        return $(element).height();

      default:
        return $(element).css(style);
      }
    };

    // get the inital values
    $.forEach(stylesToObserve, function(style) {
      oldStyles[style] = getStyle(style);
    });

    var observer = new MutationObserver(function(mutations) {
      var changeSet = {};

      $.forEach(mutations, function(mutation) {
        if (mutation.attributeName !== 'style') return;

        var isHidden = $.isDisplayNone(element);

        $.forEach(stylesToObserve, function(style) {
          if(isHidden && (style === 'width' || style === 'height')) return;

          var newValue = getStyle(style);

          if (newValue !== oldStyles[style]) {
            changeSet[style] = [oldStyles[style], newValue];
            oldStyles[style] = newValue;
          }
        });
      });

      if (!$.isEmpty(changeSet)) {
        // Do this after so as to help avoid infinite loops of mutations.
        $.callAsync(function() {
          onChange.call(null, changeSet);
        });
      }
    });

    observer.observe(element, {
      attributes:true,
      attributeFilter: ['style'],
      childList:false,
      characterData:false,
      subtree:false
    });

    return observer;
  }
1228712
function() {
    ElementController.call(this, this.observations);
    this.observersEnabled = false;
    this.listenersEnabled = false;

    if (this.expression && this.updated !== Binding.prototype.updated) {
      // An observer to observe value changes to the expression within a context
      this.observer = this.watch(this.expression, this.updated);
    }
    this.created();
  }
304712
public void onValueChange(ValueChangeEvent<String> event) {

        cancelQuickFilterTimer();
        if (event.getSource() == m_sortSelectBox) {
            // depending on the sort value the tab may or may not have the quick filter ability
            if (hasQuickFilter()) {
                if (m_quickSearch == null) {
                    createQuickBox();
                }
            } else {
                removeQuickBox();
            }
            getTabHandler().onSort(event.getValue(), hasQuickFilter() ? m_quickSearch.getFormValueAsString() : null);
        }
        if ((event.getSource() == m_quickSearch)) {
            if (hasQuickFilter()) {

                if ((CmsStringUtil.isEmptyOrWhitespaceOnly(event.getValue()) || (event.getValue().length() >= 3))) {
                    // only act if filter length is at least 3 characters or empty
                    if ((m_lastQuickSearchValue == null) || !m_lastQuickSearchValue.equals(event.getValue())) {
                        scheduleQuickFilterTimer();
                    }
                    m_lastQuickSearchValue = event.getValue();
                }
            } else {
                checkQuickSearchStatus();
            }
        }
    }
272568
function Observer(obj, keypath, callback, options) {
    this.options = options || {}
    this.options.adapters = this.options.adapters || {}
    this.obj = obj
    this.keypath = keypath
    this.callback = callback
    this.objectPath = []
    this.update = this.update.bind(this)
    this.parse()

    if (isObject(this.target = this.realize())) {
      this.set(true, this.key, this.target, this.callback)
    }
  }
512179
function mxValueChange(model, cell, value)
{
	this.model = model;
	this.cell = cell;
	this.value = value;
	this.previous = value;
}
1220539
public void setControlValue(Object objValue)
    {
        boolean bDisplayData = (m_converter.getData() != objValue); // Displaying the same value will cause an endless loop

        boolean isModified = false;
        if (m_converter.getField() != null)
            isModified = m_converter.getField().isModified();
        m_converter.setData(objValue, bDisplayData, Constants.READ_MOVE);    // DO NOT! Display (will loop)
        String strDate = m_converter.toString();    // Get it in string format.
        m_converter.setString(strDate, false, Constants.READ_MOVE); // This validates the date
        if (m_converter.getField() != null)
            m_converter.getField().setModified(isModified);
        m_tf.setText(m_converter.toString());
    }
1014809
@Override
    public void setValue(Double value, boolean fireEvents) {
        Double old = getValue();
        if (old == value || old != null && old.equals(value)) return;
        internVal = value;
        setInputValueAttr(value);
        ignoreChange = true;
        try {
            refresh(input.getElement().getId(), doubleToNiceStr(value));
        } finally {
            ignoreChange = false;
        }
        if (fireEvents) ValueChangeEvent.fire(this, value);
    }
689091
def on_change(self, value):
        ''''''
        self._modifier(self.inst, self.prop, value)
504984
function startWatchingForValueChange(target, targetInst) {
	  activeElement = target;
	  activeElementInst = targetInst;
	  activeElementValue = target.value;
	  activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');

	  // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
	  // on DOM elements
	  Object.defineProperty(activeElement, 'value', newValueProp);
	  if (activeElement.attachEvent) {
	    activeElement.attachEvent('onpropertychange', handlePropertyChange);
	  } else {
	    activeElement.addEventListener('propertychange', handlePropertyChange, false);
	  }
	}
703787
void changedValue(Object value) {
		Object oldValue = super.putSilent(VALUE, value);
		if (!Objects.equals(oldValue, value)) {
			fireChange();
		}
	}
1508
function () {
            var el = this.opts.element, observer, self = this;

            el.on("change.select2", this.bind(function (e) {
                if (this.opts.element.data("select2-change-triggered") !== true) {
                    this.initSelection();
                }
            }));

            this._sync = this.bind(function () {

                // sync enabled state
                var disabled = el.prop("disabled");
                if (disabled === undefined) disabled = false;
                this.enable(!disabled);

                var readonly = el.prop("readonly");
                if (readonly === undefined) readonly = false;
                this.readonly(readonly);

                syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
                this.container.addClass(evaluate(this.opts.containerCssClass, this.opts.element));

                syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
                this.dropdown.addClass(evaluate(this.opts.dropdownCssClass, this.opts.element));

            });

            // IE8-10 (IE9/10 won't fire propertyChange via attachEventListener)
            if (el.length && el[0].attachEvent) {
                el.each(function() {
                    this.attachEvent("onpropertychange", self._sync);
                });
            }

            // safari, chrome, firefox, IE11
            observer = window.MutationObserver || window.WebKitMutationObserver|| window.MozMutationObserver;
            if (observer !== undefined) {
                if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; }
                this.propertyObserver = new observer(function (mutations) {
                    $.each(mutations, self._sync);
                });
                this.propertyObserver.observe(el.get(0), { attributes:true, subtree:false });
            }
        }
383597
protected void valueChanged()
	{
		String newValue = fViewer.getDocument().get();
		if (!newValue.equals(fOldValue))
		{
			fOldValue = newValue;

		}
		refreshValidState();
	}
1097273
function(value) {
			var $input = this.$control_input;
			var changed = $input.val() !== value;
			if (changed) {
				$input.val(value).triggerHandler('update');
				this.lastValue = value;
			}
		}
707938
function (object, property, value) {
        if (object[OBSERVER_PROPERTY]) {
            var exists = ownProperty.call(object, property), oldVal = object[property], sz1 = object.length, chgset=null;
            object[property] = value;

            if (!exists) {
                chgset=[changeDesc(object, property, value, oldVal, "new")];
            } else if (oldVal !== value) {
                // do nothing if the value did not change or was not created:
                chgset=[changeDesc(object, property, value, oldVal, "updated")];
            }
            if (object.constructor === Array) {
                var sz2 = object.length;
                if (sz1 !== sz2) {
                    if (!chgset) {
                        chgset=[];
                    }
                    chgset.push(changeDesc(object, "length", sz2, sz1, "updated"));
                }
            }
            if (chgset) {
                callObservers(object, chgset);
            }
        } else {
            object[property] = value;
        }
        return value;
    }