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

argument type mismatch when try to get @ScopeParam with @ref value

    XMLWordPrintable

    Details

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

      Description

      java.lang.IllegalArgumentException: argument type mismatch
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.zkoss.bind.impl.ParamCall.call(ParamCall.java:109)
      	at org.zkoss.bind.impl.AbstractAnnotatedMethodInvoker.invokeMethod(AbstractAnnotatedMethodInvoker.java:87)
      	at org.zkoss.bind.impl.BinderImpl.init(BinderImpl.java:326)
      	at org.zkoss.bind.AnnotateBinder.init(AnnotateBinder.java:57)
      	at org.zkoss.bind.BindComposer.doBeforeComposeChildren(BindComposer.java:155)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.doBeforeComposeChildren(UiEngineImpl.java:875)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:814)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:772)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:681)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:744)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:703)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:644)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.createComponents(UiEngineImpl.java:1025)
      	at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:246)
      	at org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:238)
      	at org.zkoss.zul.Include.afterCompose(Include.java:451)
      	at org.zkoss.zul.Include.applyChangesToContent(Include.java:345)
      	at org.zkoss.zul.Include.fixMode(Include.java:327)
      	at org.zkoss.zul.Include.setSrc(Include.java:280)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.zkoss.zel.BeanELResolver.setValue(BeanELResolver.java:171)
      	at org.zkoss.zel.CompositeELResolver.setValue(CompositeELResolver.java:83)
      	at org.zkoss.zel.CompositeELResolver.setValue(CompositeELResolver.java:83)
      	at org.zkoss.xel.zel.XelELResolver.setValue(XelELResolver.java:114)
      	at org.zkoss.bind.xel.zel.BindELResolver.setValue(BindELResolver.java:110)
      	at org.zkoss.zel.impl.parser.AstValue.setValue(AstValue.java:249)
      	at org.zkoss.zel.impl.ValueExpressionImpl.setValue(ValueExpressionImpl.java:256)
      	at org.zkoss.xel.zel.ELXelExpression.setValue(ELXelExpression.java:50)
      	at org.zkoss.bind.impl.BindEvaluatorXImpl.setValue(BindEvaluatorXImpl.java:51)
      	at org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:81)
      	at org.zkoss.bind.impl.PropertyBindingHandler.doLoadBinding(PropertyBindingHandler.java:171)
      	at org.zkoss.bind.impl.PropertyBindingHandler.doLoad(PropertyBindingHandler.java:372)
      	at org.zkoss.bind.impl.BinderImpl.loadComponentProperties(BinderImpl.java:1826)
      	at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1803)
      	at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1806)
      	at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1806)
      	at org.zkoss.bind.BindComposer$BinderKeeper$Loader.load(BindComposer.java:468)
      	at org.zkoss.bind.BindComposer$BinderKeeper.loadComponentForAllBinders(BindComposer.java:450)
      	at org.zkoss.bind.BindComposer.doAfterCompose(BindComposer.java:174)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:530)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:825)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:772)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:681)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:744)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:703)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:644)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:396)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:316)
      	at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:214)
      	at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:135)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:326)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      
      
      <zk>
      <label multiline="true">
      1.you should see all static values are ABC
      </label>
      	<window 
      		title = "Outter Window"
      		apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('org.zkoss.zktest.bind.issue.B01469ScopeParamRef')" >
      		<vlayout>
      			<hlayout>
      				Static Value : <label id="l1" value="@load(vm.staticValue)"/> 
      			</hlayout>
      		</vlayout>
      		<div>
      			<include src="@load('B01469ScopeParamRefInner.zul')" sValue="@ref(vm.staticValue)" />
      		</div>
      	</window>
      </zk>
      
      <zk>
      	<window 
      		title = "Inner Window"
      		apply="org.zkoss.bind.BindComposer" viewModel="@id('vmi') @init('org.zkoss.zktest.bind.issue.B01469ScopeParamRefInner')" >
      		<vlayout>
      			<hlayout>
      				Static Value : <label id="l2" value="@load(vmi.staticValue)"/> 
      			</hlayout>
      			<hlayout>
      				sValue : <label id="l3" value="@load(sValue)"/> 
      			</hlayout>
      		</vlayout>
      	</window>
      </zk>
      
      package org.zkoss.zktest.bind.issue;
      
      public class B01469ScopeParamRef {
      
      	String staticValue = "ABC";
      
      	public String getStaticValue() {
      		return staticValue;
      	}
      
      	public void setStaticValue(String staticValue) {
      		this.staticValue = staticValue;
      	}
      	
      }
      
      
      package org.zkoss.zktest.bind.issue;
      
      import org.zkoss.bind.annotation.ExecutionArgParam;
      import org.zkoss.bind.annotation.Init;
      import org.zkoss.bind.annotation.ScopeParam;
      
      public class B01469ScopeParamRefInner {
      
      	String staticValue;
      	
      	@Init
      	public void init(@ScopeParam("sValue") String staticValue){
      		this.staticValue = staticValue;
      	}
      
      	public String getStaticValue() {
      		return staticValue;
      	}
      
      	public void setStaticValue(String staticValue) {
      		this.staticValue = staticValue;
      	}
      }
      
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: