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

The Combobox overwrites input text with previously selected item

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.0.1
    • 8.0.0
    • None
    • Security Level: Jimmy
    • None
    • ZK 7.0.7

      Steps to reproduce

      1. run the zul below
        <zk>
        	<combobox id="combo" autodrop="true" buttonVisible="false" autocomplete="false"/>
        	<button onClick="print()" label="print"/>
        	
        	<zscript><![CDATA[
        	    import org.zkoss.zul.ext.*;
        	    /*Dictionary.getDictionary() returns a String[] containing the dictionary words*/
        		ListModel dictModel= new SimpleListModel(Locale.getAvailableLocales());
        		combo.setModel(dictModel);
        		
        		public void print(){
        			System.out.println(((Selectable)autoCombo.getModel()).getSelection());
        		}
        	]]></zscript>
        </zk>
        
      2. select the first item, ar_AE
      3. delete the last 2 character, so it's ar_

      result

      About 0.5 sec, the input text becomes ar_AE again, the previously selected value.

      expected result

      like 7.0.6, the input text keeps unchanged after deleting the last 2 chars.

      debug info

      • 7.0.6 doesn't have such issue. After deleting the last 2 chars, the input text keeps unchanged.
      • In 8.0, the au response contains selected item, selectedItemUuid_

        ....
        ['zul.inp.Comboitem','aCHPu',

        Unknown macro: {label}

        ,{},[]]],[
        ['zul.inp.Comboitem','aCHPv',

        Unknown macro: {label}

        ,{},[]]]]],["setAttr",[{$u:'aCHP0'},"repos",true]],["setAttr",[{$u:'aCHP0'},"selectedItemUuid_","aCHPh"]]],"rid":8}

        but 7.0.6 doesn't have.

      • I think it relates to ZK-1987

            wenninghsu wenninghsu
            hawk hawk
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 3 hours, 30 minutes
                1d 3h 30m