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

Combobox upper/lowercase to selected item trigger too late before onChange

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.1
    • 8.6.0
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.6.1 S1

      Steps to Reproduce

      http://zkfiddle.org/sample/31g33oj/1-combobox-case-before-select

      Run fiddle
      In the combobox type "-abc" (dash character, then lowercase string)
      use keyboard arrow to move the carret (selection cursor) to 1st position, then use del to remove the dash.
      tab out or click out to trigger blur

      Current Result

      During blur > onChange, the onChange event is sent first (with the original abc value)
      Then, highlight triggers and format the string to uppercase
      on server side, the org.zkoss.zul.Combobox.syncValueToSelection() tries to match comboitems to the string lowercase abc

      Expected Result

      Highlight should trigger first, and the value sent to the server for org.zkoss.zul.Combobox.syncValueToSelection() should be uppercase ABC

      Debug Info

      Root Cause

      Workaround

      <script><![CDATA[  
      	zk.afterLoad('zul.inp', function() {
      		var xCombobox = {};
      		zk.override(zul.inp.Combobox.prototype, xCombobox ,{
      			updateChange_ : function() {
      				this._hilite({sendOnSelect: true, noSelectRange: true});
      				var result = xCombobox.updateChange_.apply(this, arguments);
      				return result;
      			}
      		});//zk.override
      	});//zk.afterLoad
      	]]></script>
      

            rudyhuang rudyhuang
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h