<?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: Adding rows to Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/4307.aspx</link><pubDate>Tue, 03 Apr 2007 12:59:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4307</guid><dc:creator>BhailDa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4307.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4307</wfw:commentRss><description>The answer to your particular problem as it doesn't seem to be dealing with empty tables can be found at:&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://blogs.msdn.com/infopath/archive/2006/12/15/another-way-of-sorting-repeating-data.aspx&gt;http://blogs.msdn.com/infopath/archive/2006/12/15/another-way-of-sorting-repeating-data.aspx&lt;/a&gt;</description></item><item><title>Re: Adding rows to Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/4306.aspx</link><pubDate>Tue, 03 Apr 2007 12:57:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4306</guid><dc:creator>BhailDa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4306.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4306</wfw:commentRss><description>I have a similar issue. In my scenerio I have a Purchase Order with a table for Items. I may decide top populate the entire table my pressing button which in turn uses a web service lookup. the problem being that the table doesn't exist in mamanged code until populated by the user. Therefore need to reference the inner XML from the manifest and apply this as child. Its so flacky !! I have to say I hate XPathNavigator. I'd rather pass it back to a class gerered off the schema (.xsd) and add/change nodes there. Haven't worked out how to pass values back and forth like that yet. I'm a SAP Developer not InfoPath.&lt;br /&gt;&lt;br /&gt;Code Extract:&lt;br /&gt;&lt;br /&gt;            XPathNavigator xn =  MainDataSource.CreateNavigator();&lt;br /&gt;            XPathNavigator xGroup = xn.SelectSingleNode("/my:myFields/my:group1", this.NamespaceManager);&lt;br /&gt;&lt;br /&gt;            XPathNavigator xnNode = this.Template.Manifest.SelectSingleNode("//xsf:xDocumentClass/xsf:views/xsf:view[@name='MgTest']/xsf:editing/xsf:xmlToEdit[@name='group1_3']/xsf:editWith/xsf:fragmentToInsert/xsf:chooseFragment/my:group1", this.NamespaceManager);&lt;br /&gt;            //Append the node from the Manifest file to the main DOM&lt;br /&gt;            XPathNavigator xNode = xGroup.SelectSingleNode("/my:myFields/my:group1", this.NamespaceManager);&lt;br /&gt;            DeleteNil(xNode); &lt;br /&gt;            xNode.AppendChild(xnNode.InnerXml);</description></item><item><title>Re: Adding rows to Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/4305.aspx</link><pubDate>Thu, 22 Mar 2007 18:27:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4305</guid><dc:creator>colorado_cwboy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4305.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4305</wfw:commentRss><description>Changed the code to the following.  Still the same problem.  Anyone else out there have any ideas?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;XPathNodeIterator Serversiter = ServersNAV.Select("/dfs:myFields/dfs:dataFields/dfs:Server_List/@Server", this.NamespaceManager);&lt;br /&gt; &lt;br /&gt;XPathNavigator parent = ds.CreateNavigator().SelectSingleNode("/my:myFields/my:Servers", this.NamespaceManager);&lt;br /&gt;&lt;br /&gt;            while (Serversiter.MoveNext())&lt;br /&gt;            {&lt;br /&gt;                    &lt;br /&gt;                    servers.SelectSingleNode("my:field132", this.NamespaceManager).SetValue(Serversiter.Current.Value.ToString());&lt;br /&gt;                    &lt;br /&gt;                    parent.AppendChild(servers);&lt;br /&gt;                    &lt;br /&gt;            }</description></item><item><title>Re: Adding rows to Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/4304.aspx</link><pubDate>Wed, 21 Mar 2007 22:55:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4304</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4304.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4304</wfw:commentRss><description>Weird.  I haven't played around with the IP2007 OM enough to know what's going wrong, but why are you doing this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;XPathNavigator servername = Serversiter.Current.Clone(); &lt;br /&gt;&lt;br /&gt;servers.SelectSingleNode("my:field132", this.NamespaceManager).SetValue(servername.Value.ToString());&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Couldn't it just be this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;servers.SelectSingleNode("my:field132", this.NamespaceManager).SetValue(Serversiter.Current.Value.ToString());&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Maybe cloning behaves differently with the new OM, but I have a hunch that that is why you are seeing a problem.  Maybe cloning a node automatically appends it to the "donor node's" parent.</description></item><item><title>Re: Adding rows to Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/4303.aspx</link><pubDate>Wed, 21 Mar 2007 21:17:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4303</guid><dc:creator>colorado_cwboy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4303.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4303</wfw:commentRss><description>Thanks for the reply.  But that didn't work either.  I walked through code and it's working like this.&lt;br /&gt;&lt;br /&gt; while (Serversiter.MoveNext())  Reads the iterator&lt;br /&gt;            {&lt;br /&gt;&lt;br /&gt;                    servers = servers.Clone();&lt;br /&gt;&lt;br /&gt;                    XPathNavigator servername = Serversiter.Current.Clone();  Sets the XpathNavigator to the current Node&lt;br /&gt;                    &lt;br /&gt;                    servers.SelectSingleNode("my:field132", this.NamespaceManager).SetValue(servername.Value.ToString());  Set the value to the current node&lt;br /&gt;&lt;br /&gt;                    XPathNavigator parent = ds.CreateNavigator().SelectSingleNode("/my:myFields/my:Servers", this.NamespaceManager);&lt;br /&gt;&lt;br /&gt;Now by the time I get here the node has already been added to the parent.  But I have No Idea where this is happening!  So when it hits the Append below it adds it again.&lt;br /&gt;&lt;br /&gt;                    parent.AppendChild(servers);&lt;br /&gt;                    &lt;br /&gt;            } &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Parent before the loop:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;		&amp;lt;my:group14 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-11-28T16:42:46"&amp;gt;&lt;br /&gt;			&amp;lt;my:field131&amp;gt;&amp;lt;/my:field131&amp;gt;&lt;br /&gt;			&amp;lt;my:field132&amp;gt;&amp;lt;/my:field132&amp;gt;&lt;br /&gt;			&amp;lt;my:field133&amp;gt;false&amp;lt;/my:field133&amp;gt;&lt;br /&gt;		&amp;lt;/my:group14&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Parent on the Append:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;		&amp;lt;my:group14 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-11-28T16:42:46"&amp;gt;&lt;br /&gt;			&amp;lt;my:field131&amp;gt;&amp;lt;/my:field131&amp;gt;&lt;br /&gt;			&amp;lt;my:field132&amp;gt;D1COL500&amp;lt;/my:field132&amp;gt;&lt;br /&gt;			&amp;lt;my:field133&amp;gt;false&amp;lt;/my:field133&amp;gt;&lt;br /&gt;		&amp;lt;/my:group14&amp;gt;&lt;br /&gt;	&amp;lt;my:group14 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-11-28T16:42:46"&amp;gt;&lt;br /&gt;			&amp;lt;my:field131/&amp;gt;&lt;br /&gt;			&amp;lt;my:field132&amp;gt;D1COL500&amp;lt;/my:field132&amp;gt;&lt;br /&gt;			&amp;lt;my:field133&amp;gt;false&amp;lt;/my:field133&amp;gt;&lt;br /&gt;		&amp;lt;/my:group14&amp;gt;&lt;br /&gt;</description></item><item><title>Re: Adding rows to Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/4302.aspx</link><pubDate>Wed, 21 Mar 2007 18:49:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4302</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4302.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4302</wfw:commentRss><description>Hi Robert and welcome to our forums!&lt;br /&gt;&lt;br /&gt;It's cool that you're using managed code in IP2007 - I must confess that I have not done much of this myself.  I didn't test this, but I think I see your problem. You're only cloning the 'servers' variable once.  So in the loop only the very first 'parent.AppendChild(servers)' will change the DOM.  Each subsequent call will move that node to the bottom of the children of that parent.  I'm pretty sure you will want to execute 'servers = servers.Clone()' for each iteration of the loop.&lt;br /&gt;&lt;br /&gt;I'm not 100% sure that this is the problem, but that's what my intuition tells me, so let me know if it works!</description></item><item><title>Adding rows to Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/1927.aspx</link><pubDate>Wed, 21 Mar 2007 16:48:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1927</guid><dc:creator>colorado_cwboy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1927.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1927</wfw:commentRss><description>I'm trying to add rows to a repeating table through managed code.  Everything work fine except that last data row that is read is repeated at the top of my repeating table.  Here is the code in question:&lt;br /&gt;&lt;br /&gt; DataSource ds = this.DataSources[0];&lt;br /&gt;&lt;br /&gt;            XPathNavigator servers = ds.CreateNavigator().SelectSingleNode("/my:myFields/my:Servers/my:group13/my:group14", this.NamespaceManager);&lt;br /&gt;&lt;br /&gt;            servers = servers.Clone();&lt;br /&gt;&lt;br /&gt;            XPathNavigator ServersNAV = ds3.CreateNavigator();&lt;br /&gt;&lt;br /&gt;            XPathNodeIterator Serversiter = ServersNAV.Select("/dfs:myFields/dfs:dataFields/dfs:Server_List/@Server", this.NamespaceManager);&lt;br /&gt;&lt;br /&gt;            while (Serversiter.MoveNext())&lt;br /&gt;            {&lt;br /&gt;                XPathNavigator servername = Serversiter.Current.Clone();&lt;br /&gt;&lt;br /&gt;                servers.SelectSingleNode("my:field132", this.NamespaceManager).SetValue(servername.Value.ToString());&lt;br /&gt;                &lt;br /&gt;                XPathNavigator parent = ds.CreateNavigator().SelectSingleNode("/my:myFields/my:Servers/my:group13", this.NamespaceManager);&lt;br /&gt;                parent.AppendChild(servers);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is the result:&lt;br /&gt;&lt;br /&gt;Name3&lt;br /&gt;Name1&lt;br /&gt;Name2&lt;br /&gt;Name3&lt;br /&gt;&lt;br /&gt;Notice that the last row (Name3) is being replicated at the top of the repeating table everytime.  Haven't found anyone with an answer to this one.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description></item></channel></rss>