logo       

Re: complex list within nested repeat fails: msg#00026

Subject: Re: complex list within nested repeat fails
hello dean,

please provide a complete form exposing the malfunction. this makes it
easier for us to track things down. moreover, you could file a bug
report on sourceforge.

however, you report that all works fine when you use an input instead of
an itemset. the current itemset implementation is definitely incomplete,
so this might be an indication for another itemset bug. we have itemset
on our todo list for 1.0.

regards, uli.

Dean Giesbrecht wrote:
Hello,

The following is the repeat structure on my form:

    Repeat A

      |-----Repeat B

      |            |-----Repeat C

      |-----Repeat D

When I insert any element within repeat A, B, C or D using the initial instance data containing only 1 repeat of each, I have no problems.

Within the second( or greater) Repeat A, the nested repeats still work EXCEPT for Repeat B. I get

JXPathException: No value for xpath: /prsdata/formdata/group[@name='ProductSpecGroup']/record[2]/group[@name='IngredientGroup']/record[2]/field[@name='REGN_ING']/value

(Repeat B is the “IngredientGroup” and “REGN_ING” is a complex list) What it is failing on is a complex list using select1. If I switch it to an input, the problem goes away. To baffle me even more, if I start with instance data in the model that already has a second Repeat B within the second Repeat A, when I insert a third Repeat B there is no problem.

This problem existed in both Chiba 0.9.5 and 0.9.7.

Below is the relevant code for Repeat B. I have also included the full stack trace at the end.

Any thoughts on this problem would be greatly appreciated. It would be a shame to not put this application into production because of this one problem!

Thanks,

Dean

---- Code snippet ----

<xforms:model id="esubmission-model">

<xforms:instance id="esubmission-instance">

<prsdata>

<formdata formtype="ESUB">

     <group name="ProductSpecGroup">

          <record name="ProductSpec">

               <group name="IngredientGroup">

                    <record name="Ingredient">

                         <field name="REGN_ING">

                         ...

                              <value>unit1</value>

                         </field>

                         ...

                         <group name="SupplierGroup">

                              <record name="Supplier">

<field name="NAME"><value>Supplier Name 1</value></field>

                                   ....

                              </record>

                         </group>

                    </record>

               </group>

          </record>

     </group>

</formdata>

     <listdata>

          <ingr-regn>

               <entry id="9082.0">9082 - NAME1</entry>

               <entry id="7036.0">7036 - NAME2</entry>

               <entry id="8287.0">8287 - NAME3</entry>

               <entry id="11019.0">11019 - NAME4</entry>

               <entry id="12171.0">12171 - NAME5</entry>

               <entry id="10848.0">10848 - NAME6</entry>

               <entry id="11251.0">11251 - NOT AVAILABLE</entry>

               ...

          </ingr-regn>

            ….

     </listdata>

</prsdata>
</xforms:instance>

</xforms:model>

...

<xforms:bind id="bind-lists" xforms:nodeset="/prsdata/listdata">

<xforms:bind id="bind-ING-REGN_ING-entry" xforms:nodeset="ingr-regn/entry">

          <xforms:bind id="bind-ING-REGN_ING-label" xforms:nodeset="."/>

          <xforms:bind id="bind-ING-REGN_ING-value" xforms:nodeset="@id"/>

     </xforms:bind>

     ...

</xforms:bind>

...

<xforms:bind id="bind-product-specs" xforms:nodeset="/prsdata/formdata/group[@name='ProductSpecGroup']/record">

...

<xforms:bind id="bind-ingredient-info" xforms:nodeset="group[@name='IngredientGroup']/record">

<xforms:bind id="bind-ING-REGN_ING" xforms:nodeset="field[@name='REGN_ING']/value"/>

...

<xforms:group id="group-ingredient-information" appearance="minimal">

     <br/>

     <xforms:label>

     <EN>Ingredient Information</EN>

     <FR>Renseignements sur les matières</FR>

     </xforms:label>

     <br/>

     <xforms:trigger chiba:onClick="EncryptFields(this.name);return false;">

               <xforms:label>

                   <EN>Add Ingredient</EN>

               </xforms:label>

               <xforms:action>

<xforms:insert at="index('repeat-ingredient-info')" bind="bind-ingredient-info" position="after"/>

               </xforms:action>

     </xforms:trigger>

     <xforms:trigger chiba:onClick="EncryptFields(this.name);return false;">

               <xforms:label>

                   <EN>Delete Selected Ingredient</EN>

               </xforms:label>

               <xforms:action>

<xforms:delete at="index('repeat-ingredient-info')" bind="bind-ingredient-info"/>

               </xforms:action>

     </xforms:trigger>

<xforms:repeat chiba:index="1" id="repeat-ingredient-info" bind="bind-ingredient-info" appearance="full">

...

<xforms:select1 id="REGN_ING" xforms:bind="bind-ING-REGN_ING" chiba:class="regn-ing">

          <xforms:label>

               <EN>Registration #</EN>

               <FR>No d'homologation</FR>

          </xforms:label>

<xforms:itemset id="REGN_ING-itemset" bind="bind-ING-REGN_ING-entry">

               <xforms:label bind="bind-ING-REGN_ING-label"/>

               <xforms:value bind="bind-ING-REGN_ING-value"/>

          </xforms:itemset>

          <xforms:alert>Please make selection from list</xforms:alert>

     </xforms:select1>

…

--- Full Stack Trace -----

org.apache.commons.jxpath.JXPathException: No value for xpath: /prsdata/formdata/group[@name='ProductSpecGroup']/record[2]/group[@name='IngredientGroup']/

record[2]/field[@name='REGN_ING']/value

at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:314)

at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:289)

at ca.gc.pmra.prs.xforms.chiba.xml.xforms.ui.BoundElementSource.getInstanceValue(BoundElementSource.java:294)

at org.chiba.xml.xforms.ui.AbstractFormControl.getValue(AbstractFormControl.java:161)

        at org.chiba.xml.xforms.ui.Itemset.expand(Itemset.java:262)

at org.chiba.xml.xforms.ui.Itemset.initializeItemset(Itemset.java:223)

        at org.chiba.xml.xforms.ui.Itemset.init(Itemset.java:155)

at org.chiba.xml.xforms.Initializer.initializeUIElements(Initializer.java:276)

at org.chiba.xml.xforms.ui.AbstractUIElement.initializeChildren(AbstractUIElement.java:216)

        at org.chiba.xml.xforms.ui.Select1.init(Select1.java:164)

at org.chiba.xml.xforms.Initializer.initializeUIElements(Initializer.java:276)

        at org.chiba.xml.xforms.ui.RepeatItem.init(RepeatItem.java:276)

        at org.chiba.xml.xforms.ui.Repeat.createRepeatItem(Repeat.java:505)

        at org.chiba.xml.xforms.ui.Repeat.insertRepeatItem(Repeat.java:520)

        at org.chiba.xml.xforms.ui.Repeat.handleEvent(Repeat.java:178)

        at org.apache.xerces.dom.DocumentImpl.dispatchEvent(Unknown Source)

at org.chiba.xml.xforms.XFormsDocument.dispatchEvent(XFormsDocument.java:133)

        at org.apache.xerces.dom.NodeImpl.dispatchEvent(Unknown Source)

        at org.chiba.xml.xforms.Container.dispatch(Container.java:470)

        at org.chiba.xml.xforms.Instance.insertNode(Instance.java:488)

at org.chiba.xml.xforms.action.InsertAction.perform(InsertAction.java:208)

at ..sniped...chiba.xml.xforms.action.ActionActionPrsCode.perform(ActionActionPrsCode.java:174)

at org.chiba.xml.xforms.action.AbstractAction.handleEvent(AbstractAction.java:182)

        at org.apache.xerces.dom.DocumentImpl.dispatchEvent(Unknown Source)

at org.chiba.xml.xforms.XFormsDocument.dispatchEvent(XFormsDocument.java:133)

        at org.apache.xerces.dom.NodeImpl.dispatchEvent(Unknown Source)

        at org.chiba.xml.xforms.Container.dispatch(Container.java:470)

        at org.chiba.xml.xforms.Container.dispatch(Container.java:442)

        at org.chiba.xml.xforms.Container.dispatch(Container.java:423)

        at org.chiba.xml.xforms.ChibaBean.dispatch(ChibaBean.java:500)

at ..sniped...chiba.adapter.web.HttpRequestHandlerPrsCode.handleRequest(HttpRequestHandlerPrsCode.java:101)

at ..sniped...chiba.adapter.web.HttpRequestHandlerSource.execute(HttpRequestHandlerSource.java:166)

at ..sniped...chiba.adapter.web.ServletAdapterSource.executeHandler(ServletAdapterSource.java:252)

at ..sniped...chiba.adapter.web.ChibaServletPrsCode.doPost(ChibaServletPrsCode.java:319)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

        at java.lang.Thread.run(Thread.java:534)



--
Ulrich Nicolas Lissé





-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe