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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.0.0
    • Fix Version/s: 6.0.0
    • Component/s: Databind 2
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: