<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Populate text box</title><link>https://www.infopathdev.com:443/forums/thread/52595.aspx</link><pubDate>Wed, 10 Mar 2010 15:07:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52595</guid><dc:creator>newbie999</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52595.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52595</wfw:commentRss><description>&lt;p&gt;Please disregard....I figured it out.&amp;nbsp; :)&lt;/p&gt;</description></item><item><title>Re: Populate text box</title><link>https://www.infopathdev.com:443/forums/thread/52580.aspx</link><pubDate>Tue, 09 Mar 2010 21:51:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52580</guid><dc:creator>newbie999</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52580.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52580</wfw:commentRss><description>&lt;p&gt;Thank you for the link.&amp;nbsp; This works fine, I can get the values from TFS and populate textboxes.&amp;nbsp; However, I have a repeating section so I want the user to be able to enter the id, click a button and get TFS information for the ID.&amp;nbsp; The user may then click the &amp;quot;Insert item&amp;quot; to bring up a new section with 3 textboxes and a button.&amp;nbsp; The user&amp;nbsp;may then input &lt;strong&gt;another&lt;/strong&gt; id and click the button, which&amp;nbsp;should populate the TFS information into the textboxes of the &lt;strong&gt;newly added&lt;/strong&gt; section. The problem is that the TFS information needs to populate the correct section, i.e., the one with the corresponding ID.&amp;nbsp; I&amp;#39;ve used XPathIterator to go through the nodes and figure out which one needs to be populated, but I don&amp;#39;t know how to write the information to any textboxes besides the ones in the first section.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;XML:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;lt;my:workItemIdTextBox&amp;gt;&amp;lt;/my:workItemIdTextBox&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;my:techTextBox&amp;gt;&amp;lt;/my:techTextBox&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;my:abstractTextBox&amp;gt;&amp;lt;/my:abstractTextBox&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;my:group1&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:group2&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;my:workItemId&amp;gt;1234&amp;lt;/my:workItemId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;my:field1&amp;gt;DeveloperA&amp;lt;/my:field1&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;my:field2&amp;gt;Do work&amp;lt;/my:field2&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/my:group2&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;my:group2&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:workItemId&amp;gt;5678&amp;lt;/my:workItemId&amp;gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:field1&amp;gt;&amp;lt;/my:field1&amp;gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:field2&amp;gt;&amp;lt;/my:field2&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/my:group2&amp;gt;&amp;lt;/my:group1&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;my:group3&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:group4&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;my:field7&amp;gt;&amp;lt;/my:field7&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/my:group4&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/my:group3&amp;gt;&lt;br /&gt;&amp;lt;/my:myFields&amp;gt;&lt;/p&gt;
&lt;p&gt;The code below allows me to find the node with id=5678, but I cannot access field1 and field2 for it.&amp;nbsp; I can only access field 1 and field 2 for the node with workItemID=5678&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;
&lt;p&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt; root = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;.MainDataSource.CreateNavigator();&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNodeIterator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; workItemNodes = root.Select(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:group1/my:group2/my:workItemId&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;while&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (workItemNodes.MoveNext())&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;{&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; node = nodes.Current;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (workItemNodes.Current.Name.Equals(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;my:workItemId&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;))&lt;/p&gt;
&lt;p&gt;{&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (workItemNodes.Current.Value.Equals(id.ToString()))&amp;nbsp; //id is passed in&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;Console&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.WriteLine(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;Found work item&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&amp;nbsp;&amp;nbsp; //found node with id=5678, but how to access its fields to do Set?&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;}&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Populate text box</title><link>https://www.infopathdev.com:443/forums/thread/52426.aspx</link><pubDate>Wed, 03 Mar 2010 23:28:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52426</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52426.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52426</wfw:commentRss><description>&lt;p&gt;Hi, and welcome to the forum:&lt;/p&gt;
&lt;p&gt;You can use XPathNavigator to get data from your main data source and to set values in your main data source. You sound as if you are code savvy, so &lt;a href="http://msdn.microsoft.com/en-us/library/bb509311.aspx"&gt;here&amp;#39;s&lt;/a&gt; a link to an MSDN article on &lt;strong&gt;&lt;em&gt;Working with XML Data Using the XPathNavigator Class in InfoPath 2007 Form Templates&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Populate text box</title><link>https://www.infopathdev.com:443/forums/thread/52395.aspx</link><pubDate>Wed, 03 Mar 2010 17:56:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52395</guid><dc:creator>newbie999</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52395.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52395</wfw:commentRss><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am very new to InfoPath, so please bear with me.&lt;/p&gt;
&lt;p&gt;On&amp;nbsp;my form, I&amp;nbsp;have a button,&amp;nbsp;2 text boxes and on rich text text box.&amp;nbsp; The first text box, the user is to type in an id and click the button.&amp;nbsp;I want to fetch the value in text box, do a look up in TFS based on that and then put the information in the other text boxes.&amp;nbsp; I have written code for the button_clicked event that does the look up in TFS and returns the correct data.&amp;nbsp; I have 2 issues:&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp; How do I get the text in the first text&amp;nbsp;box&amp;nbsp;so that the button_clicked event can use it to do the look up.&amp;nbsp; Right now, I&amp;#39;ve&amp;nbsp;saved the text in the text box&amp;nbsp;into a&amp;nbsp;private variable&amp;nbsp;in&amp;nbsp;the textbox_Changed event, which I then use in the&amp;nbsp;button_Clicked event.&amp;nbsp;&amp;nbsp;Is this right, or is there another&amp;nbsp;way to do it.&amp;nbsp; In C#, you can use the Text propery and get the text in a text box, but i don&amp;#39;t see anything like that here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp; I&amp;#39;m having trouble displaying&amp;nbsp;information in the second text box and the rich text box.&amp;nbsp; I have the strings saved in code under the button_Clicked event, but I don&amp;#39;t know how to get it those strings into the textboxes.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description></item></channel></rss>