Add Repeating Section

C

chrispragash

Hello Everybody,

I have an issue in programmatically adding a Repeater Section.

Here is how my schema looks:

<hb:Mother>
<hb:MotherFirstName></hb:MotherFirstName>
<hb:MotherMidName></hb:MotherMidName>
<hb:MotherLastName></hb:MotherLastName>
<hb:phone>
<hb:phoneNumber></hb:phoneNumber>
<hb:phoneNumberType>Phone 1</hb:phoneNumberType>
</hb:phone>
</hb:Mother>

The XSD specifies that the Phone Element has a maxOccurs="Unbounded".
The phone element is attached to a repeater section. In order to
programatically add a new phone row in the UI, I used the following
code:

PhoneNode = thisXDocument.DOM.createNode(1, "hb:phone", NS)
PhoneNumberNode = thisXDocument.DOM.createNode(1, "hb:phoneNumber",
NS)
PhoneNumberTypeNode = thisXDocument.DOM.createNode(1,
"hb:phoneNumberType", NS)


PhoneNode.appendChild(PhoneNumberNode)
PhoneNode.appendChild(PhoneNumberTypeNode)

thisxDocument.DOM.SelectSingleNode("/my:myFields/hb:Mother").appendChild(PhoneNode)

I keep getting an error message - Element Phone is unexpected under the
current content model of parent node Mother.

Any thoughts of suggestions on whats happening here would be really
helpful...

Thanks in advance,
Chris
 

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