java.lang.ClassCastException: org.zkoss.reference.developer.mvvm.collection.model.Item

ZK-Tracker | hawk | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    h3. Error Message: {quote} java.lang.ClassCastException: org.zkoss.reference.developer.mvvm.collection.model.Item at org.zkoss.bind.converter.sys.RadiogroupSelectedItemConverter.coerceToUi(RadiogroupSelectedItemConverter.java:59) at org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:74) 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:1802) at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1779) at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1782) at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1782) 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) {quote} h3. Reproducing Steps: 1. use the following code to reproduce the exception. {code:xml} <radiogroup selectedItem="@bind(vm.pickedItem)"> <vlayout children="@load(vm.itemList)"> <template name="children"> <radio label="@load(each)" value="@load(each)" /> </template> </vlayout> </radiogroup> {code} {{vm.pickedItem}} is an {{Item}} object. {{vm.itemList}} is {{List<Item>}} object. {code} public class Item { private String name; } {code} extracted from : https://zkbooks.googlecode.com/svn/trunk/devref/src/main/webapp/selection-radio.zul

    ZK-Tracker | 5 years ago | hawk
    java.lang.ClassCastException: org.zkoss.reference.developer.mvvm.collection.model.Item
  2. 0

    h3. Error Message: {quote} java.lang.ClassCastException: org.zkoss.reference.developer.mvvm.collection.model.Item at org.zkoss.bind.converter.sys.RadiogroupSelectedItemConverter.coerceToUi(RadiogroupSelectedItemConverter.java:59) at org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:74) 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:1802) at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1779) at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1782) at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1782) 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) {quote} h3. Reproducing Steps: 1. use the following code to reproduce the exception. {code:xml} <radiogroup selectedItem="@bind(vm.pickedItem)"> <vlayout children="@load(vm.itemList)"> <template name="children"> <radio label="@load(each)" value="@load(each)" /> </template> </vlayout> </radiogroup> {code} {{vm.pickedItem}} is an {{Item}} object. {{vm.itemList}} is {{List<Item>}} object. {code} public class Item { private String name; } {code} extracted from : https://zkbooks.googlecode.com/svn/trunk/devref/src/main/webapp/selection-radio.zul

    ZK-Tracker | 5 years ago | hawk
    java.lang.ClassCastException: org.zkoss.reference.developer.mvvm.collection.model.Item

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.zkoss.reference.developer.mvvm.collection.model.Item

      at org.zkoss.bind.converter.sys.RadiogroupSelectedItemConverter.coerceToUi()
    2. ZK Bind
      BindComposer.doAfterCompose
      1. org.zkoss.bind.converter.sys.RadiogroupSelectedItemConverter.coerceToUi(RadiogroupSelectedItemConverter.java:59)
      2. org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:74)
      3. org.zkoss.bind.impl.PropertyBindingHandler.doLoadBinding(PropertyBindingHandler.java:171)
      4. org.zkoss.bind.impl.PropertyBindingHandler.doLoad(PropertyBindingHandler.java:372)
      5. org.zkoss.bind.impl.BinderImpl.loadComponentProperties(BinderImpl.java:1802)
      6. org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1779)
      7. org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1782)
      8. org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1782)
      9. org.zkoss.bind.BindComposer$BinderKeeper$Loader.load(BindComposer.java:468)
      10. org.zkoss.bind.BindComposer$BinderKeeper.loadComponentForAllBinders(BindComposer.java:450)
      11. org.zkoss.bind.BindComposer.doAfterCompose(BindComposer.java:174)
      11 frames