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

Cannot use init annotation to a form

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.0.0
    • 6.0.0, Freshly
    • Databind 2
    • None

      Cannot convert bean.TestModel$Attr@154ebadd of type class bean.TestModel$Attr to interface org.zkoss.bind.Form

      <zk>
      	<window apply="org.zkoss.bind.BindComposer" 
      		viewModel="@id('vm')@init('bean.TestModel')">
      
      		<div form="@id('fx')@init(vm.attr)">
      			<label value="@load(fx.color)"/>
      		</div>
      	</window>
      </zk>
      
      package bean;
      
      public class TestModel {
      	private Attr attr = new Attr("blue");
      	
      	public Attr getAttr() {
      		return attr;
      	}
      	
      	
      	public static class Attr {
      		private String color;
      		public Attr(String color) {
      			this.color = color;
      		}
      		
      		public void setColor(String color) {
      			this.color = color;
      		}
      		
      		public String getColor() {
      			return color;
      		}
      	}
      }
      
      
      
      

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

              Created:
              Updated:
              Resolved: