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

Clear the input value in a spinner with binding integer value will cause UiException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.0.13, 6.5.5
    • 6.5.4
    • Databind 2
    • Security Level: Jimmy
    • None
    • None

      http://screencast.com/t/g2BtyJGNwsI

      <zk>
      	<zscript><![CDATA[
      		class MyVM {
      			private Integer number;
      			
      			private int numberInt;
      			
      			public void setNumber (Integer number) {
      				this.number = number;
      			}
      			
      			public Integer getNumber() {
      				return number;
      			}
      			
      			public void setNumberInt (int numberInt) {
      				this.numberInt = numberInt;
      			}
      			
      			public int getNumberInt() {
      				return numberInt;
      			}
      		}
      			
      	]]></zscript>
      	
      	<window apply="org.zkoss.bind.BindComposer" 
      		viewModel="@id('vm') @init('MyVM')">
      		
      		Integer: <spinner value="@bind(vm.number)"/>
      		<separator/>
      		int: <spinner value="@bind(vm.numberInt)"/>
      		 
      	</window>
      
      </zk>
      

      org.zkoss.zk.ui.UiException: Error reading 'value' on type org.zkoss.zul.Spinner at file:/C:/ws/ZK6/testZK65/src/main/webapp/test6.zul, line:32
      at org.zkoss.bind.impl.MiscUtil.mergeExceptionInfo(MiscUtil.java:175)
      at org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:48)
      at org.zkoss.bind.impl.SavePropertyBindingImpl.getComponentValue(SavePropertyBindingImpl.java:105)
      at org.zkoss.bind.impl.SavePropertyBindingImpl.save(SavePropertyBindingImpl.java:130)
      at org.zkoss.bind.impl.PropertyBindingHandler.doSaveBinding(PropertyBindingHandler.java:148)
      at org.zkoss.bind.impl.PropertyBindingHandler.doSaveEvent(PropertyBindingHandler.java:203)
      .....etc
      Caused by: org.zkoss.zel.ELException: Error reading 'value' on type org.zkoss.zul.Spinner
      at org.zkoss.zel.BeanELResolver.getValue(BeanELResolver.java:95)
      at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:66)
      at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:66)
      at org.zkoss.xel.zel.XelELResolver.getValue(XelELResolver.java:72)
      at org.zkoss.bind.xel.zel.BindELResolver.getValue(BindELResolver.java:69)
      at org.zkoss.zel.impl.parser.AstValue.getValue(AstValue.java:177)
      at org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
      at org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:40)
      at org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:46)
      ... 35 more
      Caused by: org.zkoss.zk.ui.WrongValueException: You must specify an integer, rather than null.
      at org.zkoss.zul.Spinner.getTargetValue(Spinner.java:69)
      at org.zkoss.zul.Spinner.getValue(Spinner.java:56)
      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.getValue(BeanELResolver.java:89)
      ... 43 more

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

              Created:
              Updated:
              Resolved: