<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Code to add a new row to a repeating table on a button click</title><link>https://www.infopathdev.com:443/forums/thread/22066.aspx</link><pubDate>Fri, 27 Jul 2007 16:41:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22066</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22066.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22066</wfw:commentRss><description>Glad to hear you got your problem solved!!</description></item><item><title>Re: Code to add a new row to a repeating table on a button click</title><link>https://www.infopathdev.com:443/forums/thread/22004.aspx</link><pubDate>Thu, 26 Jul 2007 12:25:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22004</guid><dc:creator>ninjaben</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22004.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22004</wfw:commentRss><description>&lt;p&gt;Excellent, thanks muchy for the help and gret example! :D&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;i got my code to work, basically i copied and tweaked code samples untill they worked&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;var parent = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:group82&amp;quot;); &lt;/p&gt;&lt;p&gt;var rowOne = parent.selectSingleNode(&amp;quot;./my:group83&amp;quot;); &lt;/p&gt;&lt;p&gt;var xmlNil = parent.ownerDocument.createNode(2, &amp;quot;xsi:nil&amp;quot;, &amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;); xmlNil.text = &amp;quot;true&amp;quot;; v&lt;/p&gt;&lt;p&gt;ar rowClone = rowOne.cloneNode(true); &lt;/p&gt;&lt;p&gt;rowClone.selectSingleNode(&amp;quot;my:Product_c&amp;quot;).text = parent.selectSingleNode(&amp;quot;../my:group84/my:field389&amp;quot;).text; &lt;/p&gt;&lt;p&gt;rowClone.selectSingleNode(&amp;quot;my:ProductType_c&amp;quot;).text = parent.selectSingleNode(&amp;quot;../my:group84/my:field393&amp;quot;).text; &lt;/p&gt;&lt;p&gt;parent.insertBefore(rowClone, rowOne);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;its a bit basic but it works wonders&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;in the end i added a rule to a button which uses the current function to move data from the current repeating section into a set of hidden textboxes then used the code above to move them to the repeating table&lt;/p&gt;</description></item><item><title>Re: Code to add a new row to a repeating table on a button click</title><link>https://www.infopathdev.com:443/forums/thread/21925.aspx</link><pubDate>Tue, 24 Jul 2007 12:10:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21925</guid><dc:creator>mhudsonjr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21925.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21925</wfw:commentRss><description>&lt;p&gt;Here is how I insert a new row in my repeating section.&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;function insertFindDataOS(pass in your parameters here)&lt;br /&gt;{&lt;br /&gt;var Findings = XDocument.DOM.selectSingleNode(&amp;quot;/my:IC3/my:CurrentFindings/my:ElemOS&amp;quot;);&lt;br /&gt;var copyFindings = Findings.cloneNode(true);&lt;br /&gt;var newRepeatRow = XDocument.DOM.createNode(1, &amp;quot;my:Finds_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newConcatRow = XDocument.DOM.createNode(1, &amp;quot;my:FindConcat_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newFindRow = XDocument.DOM.createNode(2, &amp;quot;my:Find_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newFindValueRow = XDocument.DOM.createNode(2, &amp;quot;my:FindValue_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newFindIDRow = XDocument.DOM.createNode(2, &amp;quot;my:FindID_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newElementIDRow = XDocument.DOM.createNode(2, &amp;quot;my:ElementID_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newStatusRow = XDocument.DOM.createNode(2, &amp;quot;my:Status_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newSeverityRow = XDocument.DOM.createNode(2, &amp;quot;my:Severity_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newModRow = XDocument.DOM.createNode(2, &amp;quot;my:Mod_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newMasterRow = XDocument.DOM.createNode(2, &amp;quot;my:Master_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newCatFilterRow = XDocument.DOM.createNode(2, &amp;quot;my:CatFilter_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newICD9Code = XDocument.DOM.createNode(2, &amp;quot;my:ICD9Code_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var newMasterID = XDocument.DOM.createNode(2, &amp;quot;my:MasterID_OS&amp;quot;, &amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-25T21:47:45&amp;quot;);&lt;br /&gt;var lastRow = Findings.selectNodes(&amp;quot;my:Finds_OS&amp;quot;).length;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.View.DisableAutoUpdate();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newRepeatRow.appendChild(newConcatRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newFindRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newFindValueRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newFindIDRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newElementIDRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newStatusRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newSeverityRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newModRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newMasterRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newCatFilterRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newICD9Code);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newConcatRow.setAttributeNode(newMasterID);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; copyFindings.appendChild(newRepeatRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; copyFindings.appendChild(newRepeatRow);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Findings.parentNode.replaceChild(copyFindings,Findings);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Findings = XDocument.DOM.selectSingleNode(parentPath);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastRow = Findings.selectNodes(repeatNodeName).length;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.SetNamedNodeProperty(Findings, ctrlID, lastRow);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.View.EnableAutoUpdate();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function btnInsertFindingOS::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id = &amp;quot;CTRL388&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; insertFindDataOS(set your parameters here);&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Hope this helps&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Code to add a new row to a repeating table on a button click</title><link>https://www.infopathdev.com:443/forums/thread/21713.aspx</link><pubDate>Mon, 16 Jul 2007 23:03:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21713</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21713.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21713</wfw:commentRss><description>&lt;p&gt;Repeating tables are only a visual representation of the XML data they are bound to.&lt;/p&gt;&lt;p&gt;To add a new row, use your code to insert a new row into the XML DOM.&lt;/p&gt;&lt;p&gt;So, for example if you have:&lt;/p&gt;&lt;p&gt;&amp;lt;Table&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Row attr1=&amp;quot;&amp;quot; attr2=&amp;quot;&amp;quot; attr3=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Row attr1=&amp;quot;&amp;quot; attr2=&amp;quot;&amp;quot; attr3=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Row attr1=&amp;quot;&amp;quot; attr2=&amp;quot;&amp;quot; attr3=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;/Table&amp;gt;&lt;/p&gt;&lt;p&gt;as the XML that your table is bound to, then you need to use code to insert another &amp;lt;Row attr1=&amp;quot;&amp;quot; attr2=&amp;quot;&amp;quot; attr3=&amp;quot;&amp;quot;/&amp;gt; into the &amp;lt;Table&amp;gt; node.&lt;/p&gt;&lt;p&gt;This is just basic XML DOM manipulation--not InfoPath specific. If you need help, look up some XML DOM References.&lt;/p&gt;</description></item><item><title>Code to add a new row to a repeating table on a button click</title><link>https://www.infopathdev.com:443/forums/thread/21705.aspx</link><pubDate>Mon, 16 Jul 2007 19:14:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21705</guid><dc:creator>ninjaben</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21705.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21705</wfw:commentRss><description>&lt;p&gt;Hello there!&lt;/p&gt;&lt;p&gt;ive been using infopath fora while now but im having problems with repeating tables,&lt;/p&gt;&lt;p&gt;i want to create a new row at the botom of a repeating table using JScode or maybe theres a way of using built in features, any insight you have on this lil problem of mine would be most appreciated&lt;/p&gt;&lt;p&gt;thanks in advance!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;ben&lt;/p&gt;</description></item></channel></rss>