Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-14191

Fix list widget when inside a complex sub widget

    XMLWordPrintable

    Details

      Description

      Steps to reproduce:

      • use a schema with a complex (not multi valued) inside a list
      • make this complex define a multi valued subfield

      => the list widget contribution needs to hold the property "listTemplateItem" so that nxd:defaultValue resolves it and makes it available for new list items.

      The intermediate complex makes the defaultValue method currently crash on a ClassCastException when trying to add a new element to the list:

      Caused by: javax.el.ELException: /widgets/list_widget_template.xhtml @180,64 template="#{templateValue}": /widgets/list_widget_template.xhtml @47,147 value="#{nxu:test(empty widgetProperty_listTemplateItem, nxd:propertyDefaultValue(propValueForTemplate), widgetProperty_listTemplateItem)}": java.lang.ClassCastException: org.nuxeo.ecm.core.schema.types.ComplexTypeImpl cannot be cast to org.nuxeo.ecm.core.schema.types.ListType
      	at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
      	at org.nuxeo.ecm.platform.ui.web.component.list.UIEditableList.getTemplate(UIEditableList.java:696)
      	... 100 more
      Caused by: java.lang.ClassCastException: org.nuxeo.ecm.core.schema.types.ComplexTypeImpl cannot be cast to org.nuxeo.ecm.core.schema.types.ListType
      	at org.nuxeo.ecm.platform.ui.web.tag.fn.DocumentModelFunctions.getField(DocumentModelFunctions.java:448)
      	at org.nuxeo.ecm.platform.ui.web.tag.fn.DocumentModelFunctions.defaultValue(DocumentModelFunctions.java:476)
      	at sun.reflect.GeneratedMethodAccessor723.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
      	at org.jboss.el.parser.AstFunction.getValue(AstFunction.java:84)
      	at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
      	at org.nuxeo.ecm.platform.ui.web.binding.alias.AliasValueExpression.getValue(AliasValueExpression.java:98)
      	at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:40)
      	at org.jboss.el.parser.AstEmpty.getValue(AstEmpty.java:29)
      	at org.jboss.el.parser.AstFunction.getValue(AstFunction.java:81)
      	at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
      	at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
      	at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:40)
      	at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
      	at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
      	... 101 more
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: