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

FormBinding issue with subclass and superclass objects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 7.0.4
    • Databind
    • None

      I have a combobox where it holds list of persons which also includes user objects ,as user extends person.

      On onChange event of the combobox it throws :

      Caused by: org.zkoss.zel.ELException: Cannot convert PersonDataImpl [id=40] of type class com.symeo.pms.entity.PersonDataImpl to class com.symeo.pms.entity.UserDataImpl
      at org.zkoss.zel.impl.lang.ELSupport.coerceToTypeForSetValue(ELSupport.java:490) [zel-7.0.5.jar:7.0.5]
      at org.zkoss.zel.impl.parser.AstValue.setValue(AstValue.java:246) [zel-7.0.5.jar:7.0.5]
      at org.zkoss.zel.impl.ValueExpressionImpl.setValue(ValueExpressionImpl.java:247) [zel-7.0.5.jar:7.0.5]
      at org.zkoss.xel.zel.ELXelExpression.setValue(ELXelExpression.java:50) [zcommon-7.0.5.jar:7.0.5]
      at org.zkoss.bind.impl.BindEvaluatorXImpl.setValue(BindEvaluatorXImpl.java:58) [zkbind-7.0.5.jar:7.0.5]
      ... 45 more

      Internally it tries to compare the object type ,though user is subclass of person.

      And it happens only when we use a form and bind form attribute i.e "@bind(fx.contact)" where fx is form id,if we directly bind the main object rather then middle form object i.e "@bind(vm.object.contact)" where vm is the view model this issue does not exists .

            Unassigned Unassigned
            ChaitanyaBhandari ChaitanyaBhandari
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: