title: Strange Checkbox behaviour using MVVM in ZK Framework
body: <p>I've found strange behaviour of zk checkbox in MVVM. I made a MVVM form that shows list of items and detailed view of selected item. I placed checkbox on detailed view and bind it to boolean property of my POJO. And when I select an item with true value of this property checkbox is displayed checked, but next when I select an item with false value of property and then select an item with true value again checkbox is displayed unchecked.
  I can illustrate this issue using ZK's MVVM tutorial <a href="http://books.zkoss.org/wiki/ZK_Getting_Started/Get_ZK_Up_and_Running_with_MVVM" rel="nofollow">http://books.zkoss.org/wiki/ZK_Getting_Started/Get_ZK_Up_and_Running_with_MVVM</a> (source code <a href="http://sourceforge.net/projects/zkbook/files/GettingStarted/getzkup-20131127.zip/download" rel="nofollow">http://sourceforge.net/projects/zkbook/files/GettingStarted/getzkup-20131127.zip/download</a> )</p>
  
  <p>Add to Car class boolean property:</p>
  
  <pre><code>private Boolean cool = false;
  
  public Car(Integer id, String model, String make, String description,  String preview, Integer price, boolean cool){
      this.id = id;
      this.model = model;
      this.make = make;
      this.preview = preview;
      this.description = description;
      this.price = price;
      this.cool = cool;
  }
  
  public Boolean getCool() {
      return cool;
  }
  
  public void setCool(Boolean cool) {
      this.cool = cool;
  }
  </code></pre>
  
  <p>Change CarServiceImpl.java to initialize boolean property for our demo:</p>
  
  <pre><code>carList.add(
              new Car(id++, 
                      "Camry",
                      "Toyota",
                      "The Toyota Camry is a midsize car ... ",
                      "/img/car3.png",
                      24170, true));
  carList.add(
              new Car(id++, 
                      "Century",
                      "Toyota",
                      "The Toyota Century is ... " ,          
                      "/img/car4.png",
                      28730, true));
  </code></pre>
  
  <p>Change searchMvvm.zul (add lines labeled as INSERTED):</p>
  
  <pre><code>&lt;window title="Search" width="600px" border="normal" apply="org.zkoss.bind.BindComposer"
  viewModel="@id('vm') @init('tutorial.SearchViewModel')"&gt;
  &lt;hbox align="center"&gt;
      Keyword:
      &lt;textbox value="@bind(vm.keyword)" /&gt;
      &lt;button label="Search" image="/img/search.png" onClick="@command('search')" /&gt;
  &lt;/hbox&gt;
  &lt;listbox height="160px" model="@bind(vm.carList)" emptyMessage="No car found in the result"
  selectedItem="@bind(vm.selectedCar)"&gt;
      &lt;listhead&gt;
          &lt;listheader label="Model" /&gt;
          &lt;listheader label="Make" /&gt;
          &lt;listheader label="Price" width="20%"/&gt;
          &lt;listheader label="Cool" /&gt; &lt;!-- INSERTED --&gt;
      &lt;/listhead&gt;
      &lt;template name="model"&gt;
          &lt;listitem&gt;
              &lt;listcell label="@bind(each.model)"&gt;&lt;/listcell&gt;
              &lt;listcell label="@bind(each.make)"&gt;&lt;/listcell&gt;
              &lt;listcell&gt;$&lt;label value="@bind(each.price)" /&gt;&lt;/listcell&gt;
              &lt;listcell&gt;&lt;checkbox checked="@bind(each.cool)" /&gt;&lt;/listcell&gt; &lt;!-- INSERTED --&gt;
          &lt;/listitem&gt;
      &lt;/template&gt;
  &lt;/listbox&gt;
  &lt;hbox style="margin-top:20px"&gt;
       &lt;image width="250px" src="@bind(vm.selectedCar.preview)" /&gt; 
      &lt;vbox&gt;
          &lt;label value="@bind(vm.selectedCar.model)" /&gt;
          &lt;label value="@bind(vm.selectedCar.make)" /&gt;
          &lt;label value="@bind(vm.selectedCar.price)" /&gt;
          &lt;label value="@bind(vm.selectedCar.description)" /&gt; 
          &lt;checkbox checked="@bind(vm.selectedCar.cool)" label="Cool" /&gt; &lt;!-- INSERTED --&gt;
      &lt;/vbox&gt;
  &lt;/hbox&gt;
  </code></pre>
  
  <p></p>
  
  <p>After that start Tomcat and enter localhost:8080/tutorial/searchMvvm.zul in your browser. When you click on Toyota Camry item everything is ok, but when you click on Nissan Cifiro and then on Toyota Camry again checkbox in detaled view will be displayed unchecked. But checkbox in listbox works fine.</p>
  
  <p>Do you know any workaround to solve this problem?</p>