<?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>Browser Forms</title><link>https://www.infopathdev.com:443/forums/40.aspx</link><description>For browser form specific questions</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: how can I override (?) the changed event</title><link>https://www.infopathdev.com:443/forums/thread/41928.aspx</link><pubDate>Thu, 21 May 2009 17:17:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41928</guid><dc:creator>tfiema</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41928.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=41928</wfw:commentRss><description>&lt;p&gt;OK, thanks guys. Those were good.&lt;/p&gt;
&lt;p&gt;I couldn&amp;#39;t figure out&amp;nbsp;how to bind the event handler ouside of startup, so I ended up going with a temp holder storing the identifier of which tb is actually changing.&lt;/p&gt;
&lt;p&gt;so each tb changed event looked like this. At the start it checks what is being chaged to make sure it should run: &lt;/p&gt;
&lt;p&gt;(this is for tb1)&lt;/p&gt;&lt;font color="#0000ff" size="1"&gt;&lt;font color="#0000ff" size="1"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; changing = MainDataSource.CreateNavigator().SelectSingleNode(&lt;font color="#800000"&gt;&amp;quot;/my:Form/my:changing&amp;quot;&lt;/font&gt;&lt;font size="1"&gt;;&lt;/font&gt;, NamespaceManager).Value;&lt;/font&gt;&lt;font size="1"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;&lt;font color="#0000ff" size="1"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; (e.Operation == &lt;/font&gt;&lt;font color="#008080" size="1"&gt;&lt;font color="#008080" size="1"&gt;XmlOperation&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt;.ValueChange &amp;amp;&amp;amp; (changing == &lt;/font&gt;&lt;font color="#800000" size="1"&gt;&lt;font color="#800000" size="1"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; || changing == &lt;/font&gt;&lt;font color="#800000" size="1"&gt;&lt;font color="#800000" size="1"&gt;&amp;quot;tb1&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt;))&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;{ &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;MainDataSource.CreateNavigator().SelectSingleNode(&lt;font color="#800000"&gt;&amp;quot;/my:Form/my:changing&amp;quot;&lt;/font&gt;;, NamespaceManager).SetValue(&amp;quot;tb1&amp;quot;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;MainDataSource.CreateNavigator().SelectSingleNode(&lt;font color="#800000"&gt;&amp;quot;/my:Form/my:tb2&amp;quot;&lt;/font&gt;;, NamespaceManager).SetValue(&amp;quot;my new value&amp;quot;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;//tb2 changed event will not fire because my:changing is set to &amp;quot;tb1&amp;quot;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;MainDataSource.CreateNavigator().SelectSingleNode(&lt;font color="#800000"&gt;&amp;quot;/my:Form/my:changing&amp;quot;&lt;/font&gt;;, NamespaceManager).SetValue(&amp;quot;&amp;quot;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;}&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: how can I override (?) the changed event</title><link>https://www.infopathdev.com:443/forums/thread/41912.aspx</link><pubDate>Thu, 21 May 2009 10:47:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41912</guid><dc:creator>CraigW</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41912.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=41912</wfw:commentRss><description>&lt;p&gt;It&amp;#39;s not as elegant as removing events, but I would add a 3rd element to store the name of the trigger element and test for that when each event fires.&lt;/p&gt;
&lt;p&gt;private void &lt;font size="2"&gt;TextBox1_Changed(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#008080" size="2"&gt;XmlEventArgs&lt;/font&gt;&lt;font size="2"&gt; e)&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;{&lt;br /&gt;if (ReadElement(&amp;quot;EventFiredByElement&amp;quot;) != &amp;quot;TextBox2&amp;quot;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; SetElement(&amp;quot;EventFiredByElement&amp;quot;, &amp;quot;TextBox1&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; DoWorkOnTextBox2();&lt;br /&gt;&lt;font size="2"&gt;}&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;}&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;private void &lt;font size="2"&gt;TextBox2_Changed(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#008080" size="2"&gt;XmlEventArgs&lt;/font&gt;&lt;font size="2"&gt; e)&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;{&lt;br /&gt;if (ReadElement(&amp;quot;EventFiredByElement&amp;quot;) != &amp;quot;TextBox1&amp;quot;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; SetElement(&amp;quot;EventFiredByElement&amp;quot;, &amp;quot;TextBox2&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; DoWorkOnTextBox1();&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;}&lt;/font&gt;&lt;font size="2"&gt;&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;private void DoWorkOnTextBox2()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; //do some work on TextBox2...&lt;br /&gt;&amp;nbsp;&amp;nbsp; //Clear EventFiredBy field when finished&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp; SetElement(&amp;quot;EventFiredByElement&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;font size="2"&gt;private void DoWorkOnTextBox1()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; //do some work on TextBox1...&lt;br /&gt;&amp;nbsp;&amp;nbsp; //Clear EventFiredBy field when finished&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp; SetElement(&amp;quot;EventFiredByElement&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;I *think* that would work.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Craig&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: how can I override (?) the changed event</title><link>https://www.infopathdev.com:443/forums/thread/41909.aspx</link><pubDate>Wed, 20 May 2009 23:59:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41909</guid><dc:creator>Samir Farid</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41909.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=41909</wfw:commentRss><description>&lt;p&gt;Hi tfiema,&lt;/p&gt;
&lt;p&gt;A possible solution for this is to implement code that removes the eventhandler from textbox 2 before changing it&amp;#39;s value and re-add the eventhandler&amp;nbsp;after the value is changed. &lt;/p&gt;
&lt;p&gt;&lt;u&gt;For example:&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;You need&amp;nbsp;to have 2 change events, one for Textbox1 and&amp;nbsp;one for Textbox2:&lt;/p&gt;
&lt;p&gt;public void &lt;strong&gt;changeTextbox1Event&lt;/strong&gt;()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; Remove the eventhandler of TextBox2;&lt;br /&gt;&amp;nbsp; Change the value of Textbox2 according to value in Textbox1;&lt;br /&gt;&amp;nbsp; Re-Add the eventhandler to Textbox2;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;public void &lt;strong&gt;changeTextbox2Event&lt;/strong&gt;()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; Remove the eventhandler of TextBox1;&lt;br /&gt;&amp;nbsp; Change the value of Textbox1 according to value in Textbox2;&lt;br /&gt;&amp;nbsp; Re-Add the eventhandler to Textbox1;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Let me know if this idea works for you.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>how can I override (?) the changed event</title><link>https://www.infopathdev.com:443/forums/thread/41902.aspx</link><pubDate>Wed, 20 May 2009 21:33:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41902</guid><dc:creator>tfiema</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41902.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=41902</wfw:commentRss><description>&lt;p&gt;I have 2 text boxes when the value in&amp;nbsp;tb1 changes the changed event fires and sets the tb2 value to a&amp;nbsp;number calucluated based on tb1.&lt;/p&gt;
&lt;p&gt;But, I need tb1 to do the same based on tb2. &lt;/p&gt;
&lt;p&gt;The problem is that the changed events will fire in sequece until the values stop changing. They will keep changing cause the values get rounded.&lt;/p&gt;
&lt;p&gt;anyhow, this is confusing to explain. Simply said: I would like to update tb2 and not have it&amp;#39;s changed event fire becuase I&amp;#39;m changing it from code.&lt;/p&gt;
&lt;p&gt;ANy tips would be welcome.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>