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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.6.0
    • Fix Version/s: 8.6.1
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.6.1 S1

      Description

      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>
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

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