<?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: Load data asynchronous with threads</title><link>https://www.infopathdev.com:443/forums/thread/20295.aspx</link><pubDate>Thu, 31 May 2007 08:19:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:20295</guid><dc:creator>rs200</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/20295.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=20295</wfw:commentRss><description>&lt;p&gt;thanks matt for your answer,&lt;/p&gt;&lt;p&gt;&amp;nbsp;in the meantime I found a solution, which offers Microsoft&lt;/p&gt;&lt;p&gt;http://msdn2.microsoft.com/en-us/library/aa948521(VS.80).aspx&lt;/p&gt;&lt;p&gt;i have tested it and it works, but the problem is that, i have to use a (unvisible) windows form which brings sometimes errors when the template crashes during development.&lt;/p&gt;&lt;p&gt;in this case the window will not be closed correctly and no new instances of this window can be created until i havn&amp;#39;t closed and restarted all my VS and IP instances.&lt;/p&gt;&lt;p&gt;i also have tested your proposal, it works too, but there i have the disadvantage i have to wait for an activity of the user when i want to update the data, but this is not a big problem because we have very active users :-)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;nevertheless i can say now it is possible to update the data asynchronous in a IP 2003 Form&lt;/p&gt;&lt;p&gt;-&amp;gt; create a dataloader incance&lt;/p&gt;&lt;p&gt;-&amp;gt; run the loading method in a thread&lt;/p&gt;&lt;p&gt;-&amp;gt; check whether the data have been loaded with the window or OnContextChange and update the data&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;BUT,&amp;nbsp; during my the delopment i have to look with one eye on the implemention of this solution in IP 2007 webbased Forms, because we want to switch to MOSS and IP 07 in Q3/Q4 this year.&lt;/p&gt;&lt;p&gt;Hence i have tested both ways and both won&amp;#39;t work. Because the OnContextChange event is not allowed in webbased forms and i can&amp;#39;t use local data instances, i have to store data in the FormState, which i cant access from the thread.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Any Ideas what i can do here?&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Load data asynchronous with threads</title><link>https://www.infopathdev.com:443/forums/thread/20237.aspx</link><pubDate>Tue, 29 May 2007 20:42:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:20237</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/20237.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=20237</wfw:commentRss><description>&lt;p&gt;Hi rs200,&lt;/p&gt;&lt;p&gt;For this scenario you will undoubtably have to write some strange code.&amp;nbsp; I have never done this, so I can&amp;#39;t tell you exactly, but you should do all of your data exchange between your business logic and the thread you want to run using straight C# objects and datatypes - don&amp;#39;t try to access any of the implicit InfoPath objects that are created.&amp;nbsp; Also, try using the OnContextChange event to work around some of the problems with setting the value of the nodes.&amp;nbsp; This even fires almost continuously as a user is using InfoPath, so if you need to do some hand-offs, this is the place to do it.&amp;nbsp; Make sure you right a good check to see if you want to run the code though, and don&amp;#39;t put much code in here, since it runs all the time.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Good luck, and please let us know what you figure out!&lt;/p&gt;</description></item><item><title>Load data asynchronous with threads</title><link>https://www.infopathdev.com:443/forums/thread/20169.aspx</link><pubDate>Fri, 25 May 2007 11:20:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:20169</guid><dc:creator>rs200</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/20169.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=20169</wfw:commentRss><description>&lt;p&gt;hello&lt;/p&gt;&lt;p&gt;is it possible to load data asynchronous in IP 2003 ?&lt;/p&gt;&lt;p&gt;i want to start a thread in the onload event, where i do some calculations&lt;/p&gt;&lt;p&gt;when the thread has been finished, i want to set the result to a field in the template.&lt;/p&gt;&lt;p&gt;but when i try to call thisxdocument.dom.selectsinglenode(&amp;quot;&amp;#39;//my:field1).text i get a null result and my method ends.&lt;/p&gt;&lt;p&gt;the thread and the mainform are working fine, but i can not access the thisxdocument object in the method which will be called when the thread ends.&lt;/p&gt;&lt;p&gt;&amp;nbsp;so what can i do?&lt;/p&gt;</description></item></channel></rss>