Problem with Template Part using Template Part - InfoPath Dev
in

InfoPath Dev

Problem with Template Part using Template Part

Last post 08-11-2010 09:51 AM by Carolyn2. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-18-2008 12:56 PM

    Problem with Template Part using Template Part

    Hello all,

    I'm having problems designing a form template that uses a template part which, in turn, uses a template part.

    Here are the 3 schemas (main form, which is made up of 'modules', which are made up of 'pages'):

    Main:

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:include schemaLocation="module.xsd"/>
    <xsd:element name="modules">
     <xsd:complexType>
      <xsd:sequence>
       <xsd:element ref="module" minOccurs="1" maxOccurs="4"/>
      </xsd:sequence>
     </xsd:complexType>
    </xsd:element>
    </xsd:schema>

    Module:

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:include schemaLocation="page.xsd"/>
    <xsd:element name="module">
     <xsd:complexType>
      <xsd:sequence>
       <xsd:element ref="page" minOccurs="1" maxOccurs="4"/>
      </xsd:sequence>
     </xsd:complexType>
    </xsd:element>
    </xsd:schema>

    Page:

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="page">
     <xsd:complexType>
      <xsd:sequence>
       <xsd:element name="videoElement">
     <xsd:complexType>
      <xsd:attribute name="title" type="xsd:string"/>
     </xsd:complexType>
       </xsd:element>
       <xsd:element name="audioElement">
       </xsd:element>
      </xsd:sequence>
     </xsd:complexType>
    </xsd:element>
    </xsd:schema>

    I have successfully created a template part for the Page element, based on the Page schema, and a template part for the Module element, based on the Module schema. The template part for the Module element uses the 'Page' template part, of course.

    Now that I'm designing the main form, based on the Main schema, I'm getting an error message when I try to bind the 'Module' template part (now a Custom Control) to the "module" element of the 'main' schema (the error being "Module cannot be bound to the selected field or group").

    Does anyone have any hint? What am I doing wrong?

    Many thanks in advance!

  • 06-19-2008 03:08 AM In reply to

    Re: Problem with Template Part using Template Part

    Some more info: if I create a second template part for a module (based on the same 'Module' schema) which does *not* include the 'Page' template part in it, then I am able to use this second Module template part in the Main form. So it really seems that a Template Part that includes a Template Part can not be included in a Form.

    The oddity is: why does InfoPath allow me to include a Template Part in a Template Part if I can't use that Template Part? I'm sure I must be doing something wrong :-(

  • 09-02-2009 06:22 PM In reply to

    Re: Problem with Template Part using Template Part

    Did you ever get an answer to your questions?  I am bumping into similar problems...

  • 08-11-2010 09:51 AM In reply to

    • Carolyn2
    • Top 500 Contributor
      Female
    • Joined on 07-15-2010
    • Redmond, WA
    • Posts 35

    Re: Problem with Template Part using Template Part

    Me too. I can't find any info about this on the web.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.