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

NotifyChange of a property of a Form is not reloaded.

    Details

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

      Description

      <window id="win" title="new page title" border="normal"
      	apply="org.zkoss.bind.BindComposer"
      	viewModel="@id('vm') @init('org.zkoss.zktest.bind.issue.B00911FormNotifyChange')">
      	<label multiline="true">
      		1.click notify1, all the label should change to Alex
      	</label>
      	<hbox form="@id('fx') @load(vm.person) @save(vm.person, before='save')">
      		<button label="Notify1" onClick="@command('notify1',fx=fx)" />
      		
      		<label id="l1" value="@load(fx.name)"/>
      		<label id="l2" value="@load(fx['name'])"/>
      		<label id="l3" value="@load(fx[vm.prop])"/>
      	</hbox>
      	<button label="dump" onClick="binder.tracker.dump()"/>
      </window>
      
      package org.zkoss.zktest.bind.issue;
      
      import org.zkoss.bind.BindUtils;
      import org.zkoss.bind.Form;
      import org.zkoss.bind.annotation.BindingParam;
      import org.zkoss.bind.annotation.Command;
      
      public class B00911FormNotifyChange {
      	private Person person;
      
      	public Person getPerson() {
      		return person;
      	}
      
      	public B00911FormNotifyChange() {
      		person = new Person("Dennis");
      	}
      	
      	public String getProp(){
      		return "name";
      	}
      	
      	@Command
      	public void notify1(@BindingParam("fx") Form form) {
      		form.setField("name", "Alex");
      		BindUtils.postNotifyChange(null, null, form, "name");
      	}
      	
      	public class Person {
      		private String name;
      		public Person(String name) {
      			this.name = name;
      		}
      
      		public String getName() {
      			return name;
      		}
      
      		public void setName(String name) {
      			this.name = name;
      		}
      	}
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: