<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: DocActionEvent object is Null ????</title><link>https://www.infopathdev.com:443/forums/thread/29760.aspx</link><pubDate>Wed, 25 Jun 2008 16:16:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29760</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29760.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=29760</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m not sure what this other code is you refer to. As I understand it, when you &amp;quot;create&amp;quot; a custom toolbar button, you process it as we describe. That&amp;#39;s it. Nothing else runs. Now I don&amp;#39;t know everything about custom toolbars, so maybe there&amp;#39;s some process of running some other code. In that case, here&amp;#39;s my suggestion. Set some value in a secondary DOM indicating the success status of your button code. Then when the other code runs, it can check the value of that secondary DOM node to see what it should do. But I&amp;#39;m not so sure that there is going to be any other code running--though I could be wrong.&lt;/p&gt;</description></item><item><title>Re: DocActionEvent object is Null ????</title><link>https://www.infopathdev.com:443/forums/thread/29758.aspx</link><pubDate>Wed, 25 Jun 2008 16:01:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29758</guid><dc:creator>DJ Baro</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29758.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=29758</wfw:commentRss><description>&lt;p&gt;Well, I tried using the &amp;quot;return&amp;quot; keyword. It surely stopped the process of other commands underneath it. But somehow, that&amp;#39;s not what I want.&lt;br /&gt;If we have the DocAction object, we can just set it to &amp;quot;false&amp;quot;, then other commands underneath it are still able to process until the end. Then, because of setting the DocAction object to &amp;quot;false&amp;quot;,&lt;br /&gt;The commandBar onClick will stop processing.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;intention behind this is that i write another method to hook up with the existed toolbar. Once the user click that commandBar button, they are supposed to execute my code from my method first. Once they get out from my method, the other code (dont know where it is, and don&amp;#39;t wanna care about it as well since it&amp;#39;s abstracted from being known) which is written for that commandBar button will be executed. If I am able to set the DocAction object to &amp;quot;false&amp;quot;, I would be able to stop the process of that button right after it finishes running code in my method (so that it will not execute the other code which is written somewhere else).&lt;/p&gt;
&lt;p&gt;So, any suggestion??? :(&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>Re: DocActionEvent object is Null ????</title><link>https://www.infopathdev.com:443/forums/thread/29657.aspx</link><pubDate>Mon, 23 Jun 2008 22:30:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29657</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29657.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=29657</wfw:commentRss><description>&lt;p&gt;Since there is no event object, and the function returns void, whenever you want to stop processing the button click, just do a &amp;quot;return;&amp;quot;.&lt;/p&gt;</description></item><item><title>Re: DocActionEvent object is Null ????</title><link>https://www.infopathdev.com:443/forums/thread/29563.aspx</link><pubDate>Sat, 21 Jun 2008 00:39:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29563</guid><dc:creator>DJ Baro</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29563.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=29563</wfw:commentRss><description>&lt;p&gt;Thanks Greg!!&lt;br /&gt;What if I want to check something and then I want to stop the button action.&lt;br /&gt;For example:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void btnCancel_Click(DocActionEvent e) &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &lt;br /&gt;&amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.ReturnStatus = false; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp; &lt;/p&gt;&lt;p&gt;The &amp;quot;e&amp;quot; will return false so that the button&amp;#39;s event will be stopped.&lt;/p&gt;&lt;p&gt;Anyways that I can do the same thing??? &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: DocActionEvent object is Null ????</title><link>https://www.infopathdev.com:443/forums/thread/29559.aspx</link><pubDate>Fri, 20 Jun 2008 22:58:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29559</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29559.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=29559</wfw:commentRss><description>&lt;p&gt;A custom toolbar button does not use the same function syntax as a form button does.&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t done these for a while, but if I recall correctly, you just need to create a public function of the same name as the toolbar button name, no parameters:&lt;/p&gt;
&lt;p&gt;public void btnTest()&lt;br /&gt;{&lt;br /&gt;...&lt;br /&gt;}&lt;/p&gt;</description></item><item><title>DocActionEvent object is Null ????</title><link>https://www.infopathdev.com:443/forums/thread/29549.aspx</link><pubDate>Fri, 20 Jun 2008 16:41:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29549</guid><dc:creator>DJ Baro</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29549.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=29549</wfw:commentRss><description>&lt;p&gt;Hi there, &lt;br /&gt;
&lt;/p&gt;&lt;div id="inbdy"&gt;&lt;p&gt;I&amp;#39;ve added an event to a button of my created toolbar, as below &lt;br /&gt;
&lt;/p&gt;&lt;p&gt;[InfoPathEventHandler(MatchPath=&amp;quot;btnCancel&amp;quot;,EventType=InfoPathEventType.OnC­lick)] 
&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void btnCancel_Click(DocActionEvent e) &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &lt;br /&gt;&amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.ReturnStatus = false; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;br /&gt;
&lt;/p&gt;&lt;p&gt;I got error at this point saying that &amp;quot;Object reference not set&amp;quot; &lt;br /&gt;NOTE: 
This event is fired when I click on the button of that toolbar. &lt;br /&gt;The problem 
is that &amp;quot;e&amp;quot; object is not instantiated or set.&lt;br /&gt;The toolbar is created using below code:&lt;/p&gt;&lt;p&gt;&amp;lt;xsf:toolbar caption=&amp;quot;Testing&amp;quot; name=&amp;quot;Testing Toolbar&amp;quot;&amp;gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; 
&amp;lt;xsf:button name=&amp;quot;btnTest&amp;quot; caption=&amp;quot;Testing Button&amp;quot;&amp;gt;&amp;lt;/xsf:button&amp;gt; 
&lt;br /&gt;&amp;lt;/xsf:toolbar&amp;gt; &lt;br /&gt;
&lt;/p&gt;&lt;p&gt;[InfoPathEventHandler(MatchPath=&amp;quot;btnTest&amp;quot;,EventType=InfoPathEventType.OnCli­ck)] 
&lt;br /&gt;public void btnTest_OnClick(DocActionEvent e) &lt;br /&gt;{ &lt;br /&gt;------------------- 
&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="qt" id="qhide_366301" style="display:block;"&gt;} &lt;br /&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Any suggestions??? &lt;br /&gt;
&lt;/p&gt;&lt;p&gt;Thanks &lt;br /&gt;&lt;/p&gt;&lt;/div&gt;</description></item></channel></rss>