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

Incorrect form value if inner binding waiting a command

XMLWordPrintable

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

      two issue here,
      1. a bug, that a condition-prop-binding will not enable addtracker to add the save-form field.
      2. the time issue of the save-property(to form) and save-form(to bean) when listen to same command.

      <?page title="new page title" contentType="text/html;charset=UTF-8"?>
      <window id="win" title="new page title" border="normal"
      	apply="org.zkoss.bind.BindComposer"
      	viewModel="@id('vm') @init('org.zkoss.zktest.bind.issue.B01066IncorrectFormValue')"
      	validationMessages="@id('vmsgs')">
      	<label multiline="true">
      	1.edit value, the label value should not change.
      	2.click save, two label value should change to corresponding value.
      	</label>
      	<vlayout form="@id('fx') @load(vm) @save(vm,before='save')">
      		<hlayout>
      		Value <textbox id="tb1" value="@load(fx.value1) @save(fx.value1,before='save')"/>/<label id="lb1" value="@bind(fx.value1)"/>
      		</hlayout>
      	</vlayout>
      	<label id="lb6" value="@bind(vm.value1)"/>
      	<button label="Save" onClick="@command('save')" />
      </window>
      
      package org.zkoss.zktest.bind.issue;
      
      import org.zkoss.bind.annotation.Command;
      
      public class B01066IncorrectFormValue {
      	String value1 = "A";
      	public String getValue1() {
      		return value1;
      	}
      	public void setValue1(String value1) {
      		this.value1 = value1;
      	}
      
      	@Command
      	public void save(){
      		
      	}
      }
      

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

              Created:
              Updated:
              Resolved: