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

The timing of saving textbox's value attribute to ViewModel is later than command execution on onChange event

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.0.0
    • 6.0.0
    • Databind 2

      1. Based on MVVM small talk 1 http://books.zkoss.org/wiki/Small_Talks/2011/November/MVVM_in_ZK_6_-_Design_your_first_MVVM_page example: search2.zul
      2. Bind command 'doSearch' at onChange event.
        Filter : 
        <combobox value="@bind(vm.filter)" onSelect="@command('doSearch')" onChange="@command('doSearch')">
        	<comboitem label="*" value="*"/>
        	<comboitem label="A" value="A"/>
        	<comboitem label="B" value="B"/>
        	<comboitem label="C" value="C"/>
        </combobox>
        <textbox value="@bind(vm.filter)" onChange="@command('doSearch')"/>
        
        
      3. type A, blur focus, then type B, and blur focus. You will find it displays the result when filter is 'A'. It always result of last filter value.
        • combobox with command binding at onChange only will also have this issue.

            dennis dennis
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: