<?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>Web Services</title><link>https://www.infopathdev.com:443/forums/48.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Data could not get committed to Forms Liabrary on button click event</title><link>https://www.infopathdev.com:443/forums/thread/29538.aspx</link><pubDate>Fri, 20 Jun 2008 11:03:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29538</guid><dc:creator>mehtavipulk</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29538.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=29538</wfw:commentRss><description>&lt;div&gt;&lt;font face="Tahoma" color="#000000" size="2"&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On my button click event (using &lt;span id="misspelled"&gt;VSTA&lt;/span&gt;) I explicitly set values to&amp;nbsp;one of&amp;nbsp;my InfoPath fields (which I do not&amp;nbsp;display on my form). But the InfoPath does not commit that data to the forms library. I&amp;nbsp;implemented below code to modify a field on button click event &amp;amp; submit it to Forms Library&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;private void SetFormField(&lt;span id="misspelled"&gt;XPathNavigator&lt;/span&gt; xPath, string xPathExpr, string value)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span id="misspelled"&gt;xPath.SelectSingleNode&lt;/span&gt;(xPathExpr, &lt;span id="misspelled"&gt;NamespaceManager&lt;/span&gt;).&lt;span id="misspelled"&gt;SetValue&lt;/span&gt;(value);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;SetFormField(xPath, &amp;quot;/&lt;span id="misspelled"&gt;my:myFields&lt;/span&gt;/&lt;span id="misspelled"&gt;my:Field1&lt;/span&gt;&amp;quot;, &amp;quot;1&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The value/data &amp;quot;1&amp;quot; does not get committed to Forms Library&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;While submitting the data using &lt;span id="misspelled"&gt;VSTA&lt;/span&gt;, do I need to do set some properties to &lt;span id="misspelled"&gt;explicityly&lt;/span&gt; commit data back to forms library?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Regards,&lt;/p&gt;
&lt;p&gt;&lt;span id="misspelled"&gt;Vipul&lt;/span&gt; Mehta&lt;/p&gt;&lt;/font&gt;&lt;/div&gt;</description></item></channel></rss>