<?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: How to get row number (index) in repeating table from a button click inside the table</title><link>https://www.infopathdev.com:443/forums/thread/22368.aspx</link><pubDate>Thu, 16 Aug 2007 18:27:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22368</guid><dc:creator>stpowell</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22368.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22368</wfw:commentRss><description>&lt;span style="FONT-SIZE:12pt;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-no-proof:yes;"&gt;Yes Group2 is the name of the repeating table (see my orginal post for the data structure).&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-no-proof:yes;"&gt;Could the prblem be that I am coding in VB and not jscript?&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;I was told that&lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;&lt;span style="FONT-SIZE:12pt;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;"&gt;count(preceding-sibling::Group2) + 1&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE:12pt;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;"&gt;is jscript.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Maybe you can’t mix jscript in the button rules when using VB code&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;"&gt;&amp;nbsp;&lt;/span&gt; 
&lt;p class="MsoNoSpacing" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:12pt;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;"&gt;Any other ideas?&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: How to get row number (index) in repeating table from a button click inside the table</title><link>https://www.infopathdev.com:443/forums/thread/22355.aspx</link><pubDate>Thu, 16 Aug 2007 10:18:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22355</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22355.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22355</wfw:commentRss><description>just to be sure is Group2 really the name of your repeating section or do you use the correct name in your solution and just didn&amp;#39;t post it here because in my opinoin your statement seems to be correct.</description></item><item><title>Re: How to get row number (index) in repeating table from a button click inside the table</title><link>https://www.infopathdev.com:443/forums/thread/22336.aspx</link><pubDate>Wed, 15 Aug 2007 02:37:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22336</guid><dc:creator>stpowell</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22336.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22336</wfw:commentRss><description>&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;I tried putting in &lt;strong&gt;count(preceding-sibling::Group2) + 1&lt;/strong&gt; as the value and when I clicked the verified the formula button, I received the following error:&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;quot;preceding-sibling::Group2&amp;quot; does not point to a valid location path of a field or group.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;I then tried &lt;strong&gt;count(&amp;ldquo;preceding-sibling::Group2&amp;rdquo;) + 1 &lt;/strong&gt;and got the following error message:&lt;strong&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Argument 1 must return a node-set.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;--&amp;gt;count(&amp;quot;preceding-sibling::Group2&amp;quot;)&amp;lt;-- + 1&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Anyone have any other ideas?&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Steve&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: How to get row number (index) in repeating table from a button click inside the table</title><link>https://www.infopathdev.com:443/forums/thread/22331.aspx</link><pubDate>Tue, 14 Aug 2007 16:30:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22331</guid><dc:creator>Catharine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22331.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22331</wfw:commentRss><description>&lt;p&gt;Hi&amp;nbsp; I was wanting to do something similar.&amp;nbsp; I created an additional hidden field in my group - with a default value of &lt;/p&gt;&lt;p&gt;count(preceding-sibling::Group2) + 1&lt;/p&gt;&lt;p&gt;then when the button is clicked the value in the hidden field can be used.&lt;/p&gt;&lt;p&gt;Just an idea&lt;/p&gt;&lt;p&gt;Catharine&lt;/p&gt;</description></item><item><title>Re: How to get row number (index) in repeating table from a button click inside the table</title><link>https://www.infopathdev.com:443/forums/thread/22319.aspx</link><pubDate>Tue, 14 Aug 2007 05:33:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22319</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22319.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22319</wfw:commentRss><description>it&amp;#39;s not c# it&amp;#39;s jscript. try to replace var with set</description></item><item><title>Re: How to get row number (index) in repeating table from a button click inside the table</title><link>https://www.infopathdev.com:443/forums/thread/22304.aspx</link><pubDate>Mon, 13 Aug 2007 14:43:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22304</guid><dc:creator>stpowell</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22304.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22304</wfw:commentRss><description>&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:12pt;font-family:'Times New Roman','serif';"&gt;I have found another post that shows&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:12pt;font-family:'Times New Roman','serif';"&gt;var nCount = eventObj.Source.selectNodes(&amp;quot;preceding-sibling::Row&amp;quot;).length + 1;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:12pt;font-family:'Times New Roman','serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:12pt;font-family:'Times New Roman','serif';"&gt;and it states that this should give me the current row.&lt;span&gt;&amp;nbsp; &lt;/span&gt;However I believe this code is for C#.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Assuming that it works in C#, is there a VB syntax of this code?&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: How to get row number (index) in repeating table from a button click inside the table</title><link>https://www.infopathdev.com:443/forums/thread/22302.aspx</link><pubDate>Mon, 13 Aug 2007 14:31:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22302</guid><dc:creator>stpowell</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22302.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22302</wfw:commentRss><description>&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:12pt;font-family:'Times New Roman','serif';"&gt;Position() &lt;span&gt;&amp;nbsp;&lt;/span&gt;is not recognized as a valid function in InfoPath 2007 using VB.&lt;span&gt;&amp;nbsp; &lt;/span&gt;In VB you do use brackets.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:12pt;font-family:'Times New Roman','serif';"&gt;I am beginning to wonder if&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:12pt;font-family:'Times New Roman','serif';"&gt;e.Source.Select(&lt;span style="color:#a31515;"&gt;&amp;quot;XXX&amp;quot;&lt;/span&gt;).CurrentPosition&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:12pt;font-family:'Times New Roman','serif';"&gt;is correct.&lt;span&gt;&amp;nbsp; &lt;/span&gt;No mater what I put in for the &lt;span style="color:#a31515;"&gt;XXX&lt;/span&gt; the CurrentPosition always returns a value of zero.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:12pt;font-family:'Times New Roman','serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:12pt;font-family:'Times New Roman','serif';"&gt;Are there any other ideas from all the experts?&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: How to get row number (index) in repeating table from a button click inside the table</title><link>https://www.infopathdev.com:443/forums/thread/22294.aspx</link><pubDate>Mon, 13 Aug 2007 05:57:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22294</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22294.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22294</wfw:commentRss><description>i guess that myFields/group1/group2[position()]/field1 will give you the value you need. not completely sure, just play around a bit with the position and/or the last() function and the xPath. take care of the bracktes could be () in VB instead of []. hope this helps</description></item><item><title>How to get row number (index) in repeating table from a button click inside the table</title><link>https://www.infopathdev.com:443/forums/thread/22293.aspx</link><pubDate>Sun, 12 Aug 2007 17:02:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22293</guid><dc:creator>stpowell</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22293.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22293</wfw:commentRss><description>&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;I am using InfoPath 2007 and writing code in VB.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;I have a repeating table and in the last column I have a button.&lt;span&gt;&amp;nbsp; &lt;/span&gt;When I click on the button I want to determine the row number (index) among other things. &lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;I have already figured out how to read the date in the row that I click the button.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;color:green;font-family:'Courier New';"&gt;e.Source.SelectSingleNode(&amp;quot;my:field1&amp;quot;, NamespaceManager()).Value&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;color:green;font-family:'Courier New';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;I have tried&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;e.Source.Select(&lt;span style="color:#a31515;"&gt;&amp;quot;XXX&amp;quot;&lt;/span&gt;).CurrentPosition&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;However I can&amp;rsquo;t figure out what to put in for the xpath string (Note: the XXX is just a placeholder for my question)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;I created a test case inored to try determin the the correct code to use.&lt;span&gt;&amp;nbsp; &lt;/span&gt;The data structor is &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;myFields&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;group1&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;group2&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;- this is the repeating table&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;field1&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;My table looks like&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;---------------------------&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;|&lt;span&gt;&amp;nbsp; &lt;/span&gt;text field&lt;span&gt;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp; &lt;/span&gt;button&lt;span&gt;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;- Clicking this button should return row 1&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;---------------------------&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;|&lt;span&gt;&amp;nbsp; &lt;/span&gt;text field&lt;span&gt;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp; &lt;/span&gt;button&lt;span&gt;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;- Clicking this button should return row 2&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;---------------------------&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;|&lt;span&gt;&amp;nbsp; &lt;/span&gt;text field&lt;span&gt;&amp;nbsp; &lt;/span&gt;!&lt;span&gt;&amp;nbsp; &lt;/span&gt;button&lt;span&gt;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;- Clicking this button should return row 3&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;---------------------------&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Thank you for your help&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Steve&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>