<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : [SOLVED] Implementing Command Handlers</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : [SOLVED] Implementing Command Handlers</description>
  <pubDate>Thu, 23 Apr 2026 18:48:17 -700</pubDate>
  <lastBuildDate>Sat, 29 Sep 2007 09:04:40 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=456</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>[SOLVED] Implementing Command Handlers : Solution: override the command...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=456&amp;PID=1374#1374</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 456<br /><strong>Posted:</strong> 29-Sep-2007 at 9:04am<br /><br />Solution:&nbsp; override the command handler's save method...similar to the AddNewItem code.&nbsp; From the controller in my app, I simply called this:<DIV>&nbsp;</DIV><DIV>EntityManager.SaveAll();</DIV><DIV>&nbsp;</DIV><DIV>Cha-ching!&nbsp; Good as gold!</DIV>]]>
   </description>
   <pubDate>Sat, 29 Sep 2007 09:04:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=456&amp;PID=1374#1374</guid>
  </item> 
  <item>
   <title>[SOLVED] Implementing Command Handlers : Sure, the item shows up in the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=456&amp;PID=1373#1373</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 456<br /><strong>Posted:</strong> 29-Sep-2007 at 8:32am<br /><br />Sure, the item shows up in the control view, but when I click save, the popup says, "There is nothing to save."&nbsp; So, I try the save button on the parent toolbar...same thing.<DIV>&nbsp;</DIV><DIV>We are definitely NOT is Kansas, anymore!</DIV>]]>
   </description>
   <pubDate>Sat, 29 Sep 2007 08:32:54 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=456&amp;PID=1373#1373</guid>
  </item> 
  <item>
   <title>[SOLVED] Implementing Command Handlers : OK...here is what I did...  Within...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=456&amp;PID=1371#1371</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 456<br /><strong>Posted:</strong> 29-Sep-2007 at 8:03am<br /><br />OK...here is what I did...<DIV>&nbsp;</DIV><DIV>Within my new ControlViewTabViewController (in IdeaBlade.Cab.UI), I have </DIV><DIV><FONT color=#0000ff size=2></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2>private</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> AddNewCommandHandler&lt;T&gt;(</FONT><FONT color=#0000ff size=2>object</FONT><FONT size=2> sender, </FONT><FONT color=#2b91af size=2>EventArgs</FONT><FONT size=2> e) </FONT><FONT color=#0000ff size=2>where</FONT><FONT size=2> T : </FONT><FONT color=#0000ff size=2>class </FONT><FONT size=2>{ AddNewItem(); }</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>and</FONT></DIV><DIV><FONT color=#0000ff size=2></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2>protected</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>abstract</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> AddNewItem() ;</FONT></DIV><DIV><FONT size=2>&nbsp;</DIV></FONT><DIV><FONT size=2>From the controller in my application, I simply override AddNewItem, like this:</FONT></DIV><DIV><FONT color=#0000ff size=2></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2>protected</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> AddNewItem()<BR>{<BR></FONT><FONT color=#008000 size=2>&nbsp;&nbsp;&nbsp; //Create a new Contact with default property values<BR></FONT><FONT color=#2b91af size=2>&nbsp;&nbsp;&nbsp; ContactMaster</FONT><FONT size=2> aContact = </FONT><FONT color=#2b91af size=2>ContactMaster</FONT><FONT size=2>.Create(</FONT><FONT color=#2b91af size=2>PersistenceManager</FONT><FONT size=2>.DefaultManager, 1, mCustIndex, 0, </FONT><FONT color=#a31515 size=2>"&#091;Last Name&#093;"</FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2>"&#091;First Name&#093;"</FONT><FONT size=2>);<BR></FONT><FONT color=#008000 size=2>&nbsp;&nbsp;&nbsp; //Add the new&nbsp;contact to the list that's feeding the form.<BR></FONT><FONT size=2>&nbsp;&nbsp;&nbsp; mBindingSource.Add(aContact);<BR>&nbsp;&nbsp;&nbsp; mBindingSource.MoveLast();<BR>}</DIV></FONT><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I would imagine that there is a better way to reference the PersistenceManager, but for now, this works perfectly.</DIV></FONT>]]>
   </description>
   <pubDate>Sat, 29 Sep 2007 08:03:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=456&amp;PID=1371#1371</guid>
  </item> 
  <item>
   <title>[SOLVED] Implementing Command Handlers : I was able to get the save button...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=456&amp;PID=1368#1368</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 456<br /><strong>Posted:</strong> 28-Sep-2007 at 4:05pm<br /><br />I was able to get the save button to work.&nbsp; I had the wrong wiring back in the ToolStripAdapter.&nbsp; The save does save both the parent and the child entities (and any changes therein).&nbsp; Not a big deal...that's quite workable. <DIV>&nbsp;</DIV><DIV>I am still having trouble with the add new command.&nbsp; Not quite sure how to handle this animal.</DIV>]]>
   </description>
   <pubDate>Fri, 28 Sep 2007 16:05:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=456&amp;PID=1368#1368</guid>
  </item> 
  <item>
   <title>[SOLVED] Implementing Command Handlers : I followed the MasterDetailTabViewController...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=456&amp;PID=1367#1367</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 456<br /><strong>Posted:</strong> 28-Sep-2007 at 2:44pm<br /><br />I followed the MasterDetailTabViewController paradigm for adding command handlers in a specific context.&nbsp; My code is relatively simple since I removed the master/detail complexity from the methods that I employed.&nbsp; It is working...kind of... <DIV>&nbsp;</DIV><DIV>I have a couple of issues:</DIV><DIV>&nbsp;</DIV><DIV>1)&nbsp; The save button does not display even though I registered a SaveCommandHandler.&nbsp; This may have to do with the naming of the command name in the ToolStripAdapter.&nbsp; The save button was not part of the example.&nbsp; Is there something different that needs to happen for the save button?</DIV><DIV>&nbsp;</DIV><DIV>2)&nbsp; The add button, when clicked does nothing.&nbsp; No entity seems to be created or displayed.&nbsp; How do I get the bindingsource to update with the newly created entity?</DIV><DIV>&nbsp;</DIV><DIV>3)&nbsp; I suspect the saveall command will save all dirty entities in the manager...for all classes (customer and contact are probably in the same&nbsp;manager).&nbsp; Is it possible to establish a save within the toolbar&nbsp;for the contacts class (even an individual contact)&nbsp;only?&nbsp; (this may be a more DevForce issue than CAB)</DIV><DIV>&nbsp;</DIV><DIV>Thanks!</DIV><DIV>Bill</DIV><span style="font-size:10px"><br /><br />Edited by Linguinut - 29-Sep-2007 at 8:04am</span>]]>
   </description>
   <pubDate>Fri, 28 Sep 2007 14:44:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=456&amp;PID=1367#1367</guid>
  </item> 
 </channel>
</rss>