Atleast one Repeating Section

P

Paresh

Hi All,

I have a repeating section in my browser based infopath form. The
users can insert and/or delete repeating section(s). However, can I
restrict users from deleting all the repeating section?

I mean, I want to have atleast one repeating section in my form.

Regards,
Paresh
 
K

Kalyan G Reddy MVP (GGK Tech)

Hello

You have to manually edit the repeating table node in the myschema.xsd and
set the minoccurs to value 1

See the example:

<xsd:element name="group3">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="my:group4" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

where group3 is the repeating table node.You can set any value , depending
on the value that many rows are shown by default and cannot be deleted
 
P

Paresh

Hello

You have to manually edit the repeating table node in the myschema.xsd and
set the minoccurs to value 1

See the example:

<xsd:element name="group3">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="my:group4" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

where group3 is the repeating table node.You can set any value , depending
on the value that many rows are shown by default and cannot be deleted

--
Kalyan G Reddy - INFOPATH MVP 2007http://www.ggktech.com








- Show quoted text -

Hi Kalyan,

I am designing the form using infopath designer. I dragged a
repeating dsection and put a textbox into this section, saved the
form, then saved the source files, closed the form to modify
myschema.xsd file. Modified xsd file as you suggested, but still I am
not getting the desired result. Following is my xml:

<xsd:element name="group1">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="my:group2" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="group2">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="my:field1" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="field1" type="xsd:string"/>



Am I missing something?

Regards,
PAresh
 
K

Kalyan G Reddy MVP (GGK Tech)

Hello Paresh

You seem to have did it correctly, but I dont know why you are not getting
it now.
When you set minoccurs as 1, it will by deafult show one section and the
user will not be able to delete this default section.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top