Change thisXDocument solution to work with IP07

T

Thorsten moeller

Hi,

i am fairly new to Infopath and not a very good coder. For a problem we have
with filling a dropdownlist we found a solution, but based on IP03. We need
the following line of code in the OnLoad Event:

thisXDocument.DataObjects["DummyUsers"].DOM.loadXML(thisXDocument.DataObjects["Users"].DOM.xml);

Can anybody tell me what this has to look like in IP07 ??
What i already learned is that thisXDocument doesn't exist anymore. But i
have no idea where to look at to get this right.

Thorsten
 
S

S.Y.M. Wong-A-Ton

Here's another way to fill a drop-down in IP07:
http://www.bizsupportonline.net/inf...populate-drop-down-list-box-infopath-2007.htm

The code snippet you listed is not easy to translate one-on-one from
InfoPath 2003 to InfoPath 2007, but here are some pointers to get you started
if you want to attempt to convert it.

To get a reference to a secondary data source, you must use the DataSources
object (see
http://www.bizsupportonline.net/infopath2007/infopath-basics-main-secondary-data-source.htm).

There is no loadXML on an XPathNavigator object, so you'll have to try to
use ReplaceSelf (see
http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.replaceself.aspx)
or WriteSubtree (see
http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.writesubtree.aspx) depending on what you're trying to do.

The InnerXml property on an XPathNavigator will provide you with the ".xml"
part in your code snippet.
 
T

Thorsten moeller

Hi,

i think your hints are going into the right direction. I tried to put it to
work, but still think there is a missing link. I try to explain what i tried
to do.

As i exlpained before i need to populate a dropdown field with the content
of sharepoint users. Therefore i call a sharepoint webservice named
"GetUserCollectionFrom Site". This is the first Datasource which should be
updated, when i call the form. The problem is, that it doesn't return a
repating group for the rows., so that i can use it directly.

Therefore i need a second Datasource, which is an XML definition with
repeating groups, which takes the first one as input, reads it an produces
the correct output for the dropdownfield.

In the c# code the loading of the second datasource from the first one has
to be done. In IP2003 it is done with the code seen below.

Perhaps this makes it a little more clear what should be done and you can
give me another hint in the right direction. Hope you'll excuse that i am not
too familiar with all this xml stuff at this stage of learning.

But thanks for your attention so far.

Thorsten




S.Y.M. Wong-A-Ton said:
Here's another way to fill a drop-down in IP07:
http://www.bizsupportonline.net/inf...populate-drop-down-list-box-infopath-2007.htm

The code snippet you listed is not easy to translate one-on-one from
InfoPath 2003 to InfoPath 2007, but here are some pointers to get you started
if you want to attempt to convert it.

To get a reference to a secondary data source, you must use the DataSources
object (see
http://www.bizsupportonline.net/infopath2007/infopath-basics-main-secondary-data-source.htm).

There is no loadXML on an XPathNavigator object, so you'll have to try to
use ReplaceSelf (see
http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.replaceself.aspx)
or WriteSubtree (see
http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.writesubtree.aspx) depending on what you're trying to do.

The InnerXml property on an XPathNavigator will provide you with the ".xml"
part in your code snippet.

---
S.Y.M. Wong-A-Ton
http://www.bizsupportonline.net (100+ InfoPath articles, tutorials, and
solutions)


Thorsten moeller said:
Hi,

i am fairly new to Infopath and not a very good coder. For a problem we have
with filling a dropdownlist we found a solution, but based on IP03. We need
the following line of code in the OnLoad Event:

thisXDocument.DataObjects["DummyUsers"].DOM.loadXML(thisXDocument.DataObjects["Users"].DOM.xml);

Can anybody tell me what this has to look like in IP07 ??
What i already learned is that thisXDocument doesn't exist anymore. But i
have no idea where to look at to get this right.

Thorsten
 
S

S.Y.M. Wong-A-Ton

Hi Thorsten,

I haven't tried the specific technique you're trying to use to populate a
drop-down list box, so I cannot provide you with more hints than I already
have. When I get a chance, I'll give it a try myself and if I find a
solution, I'll write about it.

In the meantime, you can also post your question in the SharePoint forum
(http://social.msdn.microsoft.com/forums/en-US/sharepointinfopath/). I'm sure
someone has already tried doing what you're trying to do, so it might be
worthwhile also posting your question over there.

---
S.Y.M. Wong-A-Ton
http://www.bizsupportonline.net/infopath-all-solutions.htm (100+ InfoPath
articles, tutorials, and solutions)


Thorsten moeller said:
Hi,

i think your hints are going into the right direction. I tried to put it to
work, but still think there is a missing link. I try to explain what i tried
to do.

As i exlpained before i need to populate a dropdown field with the content
of sharepoint users. Therefore i call a sharepoint webservice named
"GetUserCollectionFrom Site". This is the first Datasource which should be
updated, when i call the form. The problem is, that it doesn't return a
repating group for the rows., so that i can use it directly.

Therefore i need a second Datasource, which is an XML definition with
repeating groups, which takes the first one as input, reads it an produces
the correct output for the dropdownfield.

In the c# code the loading of the second datasource from the first one has
to be done. In IP2003 it is done with the code seen below.

Perhaps this makes it a little more clear what should be done and you can
give me another hint in the right direction. Hope you'll excuse that i am not
too familiar with all this xml stuff at this stage of learning.

But thanks for your attention so far.

Thorsten




S.Y.M. Wong-A-Ton said:
Here's another way to fill a drop-down in IP07:
http://www.bizsupportonline.net/inf...populate-drop-down-list-box-infopath-2007.htm

The code snippet you listed is not easy to translate one-on-one from
InfoPath 2003 to InfoPath 2007, but here are some pointers to get you started
if you want to attempt to convert it.

To get a reference to a secondary data source, you must use the DataSources
object (see
http://www.bizsupportonline.net/infopath2007/infopath-basics-main-secondary-data-source.htm).

There is no loadXML on an XPathNavigator object, so you'll have to try to
use ReplaceSelf (see
http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.replaceself.aspx)
or WriteSubtree (see
http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.writesubtree.aspx) depending on what you're trying to do.

The InnerXml property on an XPathNavigator will provide you with the ".xml"
part in your code snippet.

---
S.Y.M. Wong-A-Ton
http://www.bizsupportonline.net (100+ InfoPath articles, tutorials, and
solutions)


Thorsten moeller said:
Hi,

i am fairly new to Infopath and not a very good coder. For a problem we have
with filling a dropdownlist we found a solution, but based on IP03. We need
the following line of code in the OnLoad Event:

thisXDocument.DataObjects["DummyUsers"].DOM.loadXML(thisXDocument.DataObjects["Users"].DOM.xml);

Can anybody tell me what this has to look like in IP07 ??
What i already learned is that thisXDocument doesn't exist anymore. But i
have no idea where to look at to get this right.

Thorsten
 

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