org.zkoss.zel.ELException: Error writing 'selectedIndex' on type org.zkoss.zul.Listbox

ZK-Tracker | dennis | 5 years ago
  1. 0

    {code:xml} <zk> <window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('issues.TestModel')"> <listbox model="@bind(vm.selBox)" mold="select" selectedIndex="@bind(vm.selIndex)"> <template name="model" var="item"> <listitem label="@bind(item)"/> </template> </listbox> <intbox value="@bind(vm.selIndex)" /> </window> </zk> {code} {code:java} public class TestModel { int selIndex; ListModelList<String> selBox; public TestModel(){ selIndex = 0; selBox = new ListModelList<String>(); selBox.add("A"); selBox.add("B"); selBox.add("C"); selBox.add("D"); selBox.add("E"); } public int getSelIndex() { return selIndex; } @NotifyChange public void setSelIndex(int selIndex) { this.selIndex = selIndex; } public ListModelList<String> getSelBox() { return selBox; } } {code} will get {code:none} org.zkoss.zel.ELException: Error writing 'selectedIndex' on type org.zkoss.zul.Listbox at org.zkoss.zel.BeanELResolver.setValue(BeanELResolver.java:142) 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:110) at org.zkoss.bind.xel.zel.BindELResolver.setValue(BindELResolver.java:68) at org.zkoss.zel.impl.parser.AstValue.setValue(AstValue.java:215) 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:48) at org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:64) at org.zkoss.bind.impl.PropertyBindingHelper.loadComponentProperties(PropertyBindingHelper.java:350) at org.zkoss.bind.impl.BinderImpl.loadComponentProperties(BinderImpl.java:1439) at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1423) at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1425) at org.zkoss.bind.BindComposer.doAfterCompose(BindComposer.java:105) {code}

    ZK-Tracker | 5 years ago | dennis
    org.zkoss.zel.ELException: Error writing 'selectedIndex' on type org.zkoss.zul.Listbox
  2. 0

    {code:xml} <zk> <window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('issues.TestModel')"> <listbox model="@bind(vm.selBox)" mold="select" selectedIndex="@bind(vm.selIndex)"> <template name="model" var="item"> <listitem label="@bind(item)"/> </template> </listbox> <intbox value="@bind(vm.selIndex)" /> </window> </zk> {code} {code:java} public class TestModel { int selIndex; ListModelList<String> selBox; public TestModel(){ selIndex = 0; selBox = new ListModelList<String>(); selBox.add("A"); selBox.add("B"); selBox.add("C"); selBox.add("D"); selBox.add("E"); } public int getSelIndex() { return selIndex; } @NotifyChange public void setSelIndex(int selIndex) { this.selIndex = selIndex; } public ListModelList<String> getSelBox() { return selBox; } } {code} will get {code:none} org.zkoss.zel.ELException: Error writing 'selectedIndex' on type org.zkoss.zul.Listbox at org.zkoss.zel.BeanELResolver.setValue(BeanELResolver.java:142) 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:110) at org.zkoss.bind.xel.zel.BindELResolver.setValue(BindELResolver.java:68) at org.zkoss.zel.impl.parser.AstValue.setValue(AstValue.java:215) 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:48) at org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:64) at org.zkoss.bind.impl.PropertyBindingHelper.loadComponentProperties(PropertyBindingHelper.java:350) at org.zkoss.bind.impl.BinderImpl.loadComponentProperties(BinderImpl.java:1439) at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1423) at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1425) at org.zkoss.bind.BindComposer.doAfterCompose(BindComposer.java:105) {code}

    ZK-Tracker | 5 years ago | dennis
    org.zkoss.zel.ELException: Error writing 'selectedIndex' on type org.zkoss.zul.Listbox
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    将ZK官方Tree组件示例用ZKUI改写时碰到的问题

    GitHub | 4 years ago | evanzeng
    org.zkoss.zel.ELException: Cannot convert demo.getting_started.Category@7dc999c4 of type class demo.getting_started.tree.CategoryTreeNode to class demo.getting_started.Category

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.zkoss.zel.ELException

      Error writing 'selectedIndex' on type org.zkoss.zul.Listbox

      at org.zkoss.zel.BeanELResolver.setValue()
    2. The ZK EL Library
      CompositeELResolver.setValue
      1. org.zkoss.zel.BeanELResolver.setValue(BeanELResolver.java:142)
      2. org.zkoss.zel.CompositeELResolver.setValue(CompositeELResolver.java:83)
      3. org.zkoss.zel.CompositeELResolver.setValue(CompositeELResolver.java:83)
      3 frames
    3. The ZKoss Common Library
      XelELResolver.setValue
      1. org.zkoss.xel.zel.XelELResolver.setValue(XelELResolver.java:110)
      1 frame
    4. ZK Bind
      BindELResolver.setValue
      1. org.zkoss.bind.xel.zel.BindELResolver.setValue(BindELResolver.java:68)
      1 frame
    5. The ZK EL Library
      ValueExpressionImpl.setValue
      1. org.zkoss.zel.impl.parser.AstValue.setValue(AstValue.java:215)
      2. org.zkoss.zel.impl.ValueExpressionImpl.setValue(ValueExpressionImpl.java:256)
      2 frames
    6. The ZKoss Common Library
      ELXelExpression.setValue
      1. org.zkoss.xel.zel.ELXelExpression.setValue(ELXelExpression.java:50)
      1 frame
    7. ZK Bind
      BindComposer.doAfterCompose
      1. org.zkoss.bind.impl.BindEvaluatorXImpl.setValue(BindEvaluatorXImpl.java:48)
      2. org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:64)
      3. org.zkoss.bind.impl.PropertyBindingHelper.loadComponentProperties(PropertyBindingHelper.java:350)
      4. org.zkoss.bind.impl.BinderImpl.loadComponentProperties(BinderImpl.java:1439)
      5. org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1423)
      6. org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1425)
      7. org.zkoss.bind.BindComposer.doAfterCompose(BindComposer.java:105)
      7 frames