Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3612

Textbox doesn't fire onChange event after being invalidated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 8.0.5
    • 8.0.3, 8.0.4.2
    • None
    • Security Level: Jean
    • None
    • None

      Simplified case

      Steps to Reproduce

      1. load the attached zul
      2. enter "ab" in the textbox
      3. label shows "ab"
      4. then enter "i" to invalidate, the label shows "abi"
      5. then enter "cd"

      Current Result

      the label still shows "abi" and no onChange event is fired

      Expected Result

      the label shows as the textbox's value and an onChange event is fired after redrawing

      Debug Info

      1. it doesn't happen before 8.0.2 (included)
      2. the original use case is: a textbox in inside a Listheader, and Listbox redraws itself causes no onChange event fired.

      Root cause

      Workaround

      <script><![CDATA[
      /*
      */
      zk.afterLoad('zul.inp', function() {
      	var xInputWidget = {};
      	zul.inp.InputWidget._onChanging = function (timeout) {
      		
      		if (this.desktop) {
      			var inp = this.getInputNode(),
      				val = this.valueEnter_ || inp.value;
      			if (this._lastChg != val) {
      				this._lastChg = val;
      				var valsel = this.valueSel_;
      				this.valueSel_ = null;
      				if (this.isListen('onChanging'))
      					this.fire('onChanging', zul.inp.InputWidget._onChangeData(this, {value: val}, valsel == val), 
      						{ignorable: 1, rtags: {onChanging: 1}}, timeout || 5);
      				if (this._instant)
      					this.updateChange_();
      			}
      		}
      	}
      });//zk.afterLoad
      ]]></script>
      
      • avoid triggering invalidate()

            wenninghsu wenninghsu
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h