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

Error when mixing ZK creation EL with zkbind on reference or element of collection

XMLWordPrintable

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

      Error when mixing ZK creation EL with zkbind on reference or element of collection

      <?xml version="1.0" encoding="UTF-8"?>
      <?page title="Auto Generated index.zul"?>
      
      <zk>
          <zscript><![CDATA[
              ListModelList lm0= new ListModelList(); 
      
              class A
              {
                  public A(String s, Long v)	{ s_= s; v_= v; }
                  
                  public String getData()		{ return s_; }
                  
                  String s_= null;
                  Long v_= null;
              }
       
             // Make first entry in ListModel
              ListModelList list= new ListModelList();
              list.add(new A("RE: Bandbox Autocomplete Problem", 0L));
              list.add(new A("RE: It's not possible to navigate a listbox' ite", 1L));
              list.add(new A("RE: FileUpload", 2L));
      	lm0.add(new Object[] {"Today", list });
              
              // Make second entry in ListModel
              list= new ListModelList();
              list.add(new A("RE: Opening more than one new browser window", 10L));
              list.add(new A("RE: SelectedItemConverter Question", 11L));
      	lm0.add(new Object[] { "Yesterday", list });
              
              // Make third entry in ListModel
              list= new ListModelList();
              list.add(new A("RE: Times_Series Chart help", 30L));
              list.add(new A("RE: SelectedItemConverter Question", 31L));
      	lm0.add(new Object[] { "Last week", list });
              
            
              class VM
              {
                  public ListModel getLm0()		{ return lm0; } 
              }
      	]]></zscript>
      
      
      	<window title="Hello World!!" border="normal" width="800px" 
      			apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('VM')" >    		    
      	
      	    <label value="You are using: ${desktop.webApp.version}"/>
          	    <listbox id="lb" model="@load(vm.lm0)" >
          		<listhead>
      	    		<listheader hflex="3"/>
      	    		<listheader hflex="6"/>
          		</listhead>
      	        <template name="model">
      	            <listitem>
      				<custom-attributes inner_list="${each[1]}" scope="component"/>
      	                <listcell>
      	                	<label value="@load(each[0])"/>
      	                </listcell>
      	                <listcell>
      			        <listbox model= "@load(inner_list)">
      				       	<template name="model">
      				       		<listitem>
      				        		<listcell label="${each.data}">
      				        		</listcell>
      				        	</listitem>
      				        </template>
      				</listbox>
      			</listcell>
      	            </listitem>
      	        </template>
      	   </listbox>
           </window>
      </zk>
      
      >>org.zkoss.zel.PropertyNotFoundException: Property 'data' not found on type org.zkoss.bind.impl.ReferenceBindingImpl
      >>	at org.zkoss.zel.BeanELResolver$BeanProperties.get(BeanELResolver.java:260)
      >>	at org.zkoss.zel.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:211)
      >>	at org.zkoss.zel.BeanELResolver.property(BeanELResolver.java:384)
      >>	at org.zkoss.zel.BeanELResolver.getValue(BeanELResolver.java:87)
      >>	at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67)
      >>	at org.zkoss.xel.zel.XelELResolver.getValue(XelELResolver.java:72)
      >>	at org.zkoss.zel.impl.parser.AstValue.getValue(AstValue.java:179)
      >>	at org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
      >>	at org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:40)
      >>	at org.zkoss.zk.xel.impl.SimpleEvaluator.evaluate(SimpleEvaluator.java:72)
      >>	at org.zkoss.zk.ui.metainfo.AbstractEvalRef.evaluate(AbstractEvalRef.java:48)
      >>	at org.zkoss.zk.xel.ExValue.getValue(ExValue.java:109)
      >>	at org.zkoss.zk.ui.metainfo.Property.getValue(Property.java:134)
      >>	at org.zkoss.zk.ui.metainfo.Property.assign0(Property.java:227)
      >>	at org.zkoss.zk.ui.metainfo.Property.assign(Property.java:169)
      >>	at org.zkoss.zk.ui.metainfo.ComponentInfo.applyProperties(ComponentInfo.java:729)
      >>	at org.zkoss.zk.ui.impl.AbstractUiFactory.newComponent(AbstractUiFactory.java:106)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:801)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:770)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:679)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:643)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:816)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:770)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:679)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.access$800(UiEngineImpl.java:86)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl$TemplateImpl.create(UiEngineImpl.java:2156)
      >>	at org.zkoss.bind.impl.BindListitemRenderer.render(BindListitemRenderer.java:70)
      >>	at org.zkoss.zul.Listbox$Renderer.render(Listbox.java:2638)
      >>	at org.zkoss.zul.Listbox.renderItems(Listbox.java:2756)
      >>	at org.zkoss.zul.Listbox.service(Listbox.java:3479)
      >>	at org.zkoss.zk.ui.impl.DesktopImpl.service(DesktopImpl.java:699)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1193)
      >>	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:558)
      >>	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:456)
      >>	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:464)
      >>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      >>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      >>	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
      >>	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
      >>	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
      >>	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
      >>	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
      >>	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
      >>	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
      >>	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
      >>	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
      >>	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
      >>	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
      >>	at org.eclipse.jetty.server.Server.handle(Server.java:349)
      >>	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
      >>	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
      >>	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948)
      >>	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:857)
      >>	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
      >>	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
      >>	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
      >>	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
      >>	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
      >>	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
      >>	at java.lang.Thread.run(Thread.java:662)
      

            iantsai iantsai
            dennis dennis
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: