AnsweredAssumed Answered

WebForms error with maxOccurs > 1

Question asked by mark.smithson on Aug 13, 2007
Latest reply on Aug 20, 2007 by kvc
According to the docs in the wiki, when a schema element has maxOccurs > 1, the web form will render a repeater for the element.

This works fine for a simple type such as xs:normalizedString, but does not work when the element type is restricted by an enumeration. When you try and render the form, you get this error.

org.chiba.xml.xforms.exception.XFormsBindingException: property 'constraint' already present at model item
org.alfresco.web.forms.FormProcessor$ProcessingException: org.chiba.xml.xforms.exception.XFormsBindingException: property 'constraint' already present at model item
   at org.alfresco.web.forms.xforms.XFormsProcessor.process(XFormsProcessor.java:150)
   at org.alfresco.web.forms.xforms.XFormsProcessor.process(XFormsProcessor.java:121)
   at org.alfresco.web.ui.wcm.component.UIFormProcessor.encodeBegin(UIFormProcessor.java:123)
   at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:467)
   at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:320)
   at org.apache.jsp.jsp.wcm.create_002dweb_002dcontent_002dwizard.create_002dxml_jsp._jspx_meth_wcm_005fformProcessor_005f0(create_002dxml_jsp.java:116)
   at org.apache.jsp.jsp.wcm.create_002dweb_002dcontent_002dwizard.create_002dxml_jsp._jspService(create_002dxml_jsp.java:82)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
   at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
   at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
   at org.apache.jsp.jsp.wizard.container_jsp._jspService(container_jsp.java:536)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
   at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
   at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
   at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
   at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Unknown Source)
Caused by: org.chiba.xml.xforms.exception.XFormsBindingException: property 'constraint' already present at model item
   at org.chiba.xml.xforms.core.Bind.initializeModelItemProperties(Bind.java:517)
   at org.chiba.xml.xforms.core.Bind.initializeModelItems(Bind.java:454)
   at org.chiba.xml.xforms.core.Bind.init(Bind.java:367)
   at org.chiba.xml.xforms.Initializer.initializeBindElements(Initializer.java:214)
   at org.chiba.xml.xforms.core.Bind.init(Bind.java:368)
   at org.chiba.xml.xforms.Initializer.initializeBindElements(Initializer.java:214)
   at org.chiba.xml.xforms.core.Bind.init(Bind.java:368)
   at org.chiba.xml.xforms.Initializer.initializeBindElements(Initializer.java:214)
   at org.chiba.xml.xforms.core.Model.modelConstruct(Model.java:853)
   at org.chiba.xml.xforms.core.Model.performDefault(Model.java:746)
   at org.chiba.xml.events.impl.DefaultXMLEventService.dispatch(DefaultXMLEventService.java:286)
   at org.chiba.xml.xforms.Container.dispatch(Container.java:481)
   at org.chiba.xml.xforms.Container.dispatch(Container.java:459)
   at org.chiba.xml.xforms.Container.initModels(Container.java:696)
   at org.chiba.xml.xforms.Container.init(Container.java:325)
   at org.chiba.xml.xforms.ChibaBean.init(ChibaBean.java:410)
   at org.alfresco.web.forms.xforms.XFormsBean.setXFormsSession(XFormsBean.java:244)
   at org.alfresco.web.forms.xforms.XFormsProcessor.process(XFormsProcessor.java:140)
   … 51 more

Is this a bug, or is it intentional and I am missing something?

Outcomes