<?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: Email Adapter &amp; Repeating Table in Jscript</title><link>https://www.infopathdev.com:443/forums/thread/23187.aspx</link><pubDate>Wed, 19 Sep 2007 16:31:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23187</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23187.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=23187</wfw:commentRss><description>&lt;p&gt;The problem is your select code. Your absolute XPath is saying to go back to the root node, then find the field.... If you follow the logic of your XPath, you will see that it will of course always select the first row. It has no other choice.&lt;/p&gt;
&lt;p&gt;The trick here is that eventObj.Source points to the row that the button is located on. So you only need to use a relative XPath from here.&lt;/p&gt;
&lt;p&gt;Assuming that my:group16 is your repeating node in your DOM... then that would be what the eventObj.Source points to, and you would only need a select stament like this:&lt;/p&gt;
&lt;p&gt;var varTo = eventObj.Source.selectSingleNode(&amp;quot;my:field75&amp;quot;).text;&lt;/p&gt;
&lt;p&gt;Hope that helps!&lt;/p&gt;</description></item><item><title>Email Adapter &amp; Repeating Table in Jscript</title><link>https://www.infopathdev.com:443/forums/thread/23153.aspx</link><pubDate>Tue, 18 Sep 2007 17:10:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23153</guid><dc:creator>lizlee00</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23153.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=23153</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have a repeating table on my form with three fields: Recipient, Task, Due Date.&amp;nbsp; For each row of the table I have a button.&amp;nbsp; When the button is clicked I want an email submit to occur with the recipient, task and due date info coming from that particular row.&amp;nbsp; Using code I found on these forums I have come up with the following code.&amp;nbsp; However, when the button from row 2 is pushed, the email adapter wants to submit the email using data from row 1.&amp;nbsp; So it does not appear to be working properly yet.&amp;nbsp; If anyone could help me out with this that would be great.&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;a class="" name="OLE_LINK4"&gt;&lt;/a&gt;&lt;a class="" name="OLE_LINK3"&gt;&lt;/a&gt;&lt;a class="" name="OLE_LINK2"&gt;&lt;/a&gt;&lt;a class="" name="OLE_LINK1"&gt;&lt;/a&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;var objEmailAdapter; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;var varTo = eventObj.Source.selectSingleNode(&amp;quot;/my:myFields/my:group15/my:group16/my:field75&amp;quot;).text; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;var varSubject = eventObj.Source.selectSingleNode(&amp;quot;/my:myFields/my:group15/my:group16/my:field74&amp;quot;).text; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;var bodyText = &amp;#39;You have a new Action Item:\n&amp;#39;; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;var bodyDue = &amp;#39;\n\nDue Date:\n&amp;#39;; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;var varIntro = eventObj.Source.selectSingleNode(&amp;quot;/my:myFields/my:group15/my:group16/my:field74&amp;quot;).text; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;var varDue = eventObj.Source.selectSingleNode(&amp;quot;/my:myFields/my:group15/my:group16/my:field68&amp;quot;).text; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;objEmailAdapter = XDocument.DataAdapters(&amp;quot;Email Submit&amp;quot;); &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;objEmailAdapter.To = varTo; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;objEmailAdapter.Intro = bodyText + varIntro + bodyDue + varDue; objEmailAdapter.Subject = varSubject.text; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;objEmailAdapter.Submit();&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>