<?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 : Instance Validation and UI Messages</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Instance Validation and UI Messages</description>
  <pubDate>Mon, 13 Apr 2026 12:29:22 -700</pubDate>
  <lastBuildDate>Mon, 13 Jun 2011 13:11:41 -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=2753</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>Instance Validation and UI Messages : Hi LawyerDev;There are actually...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2753&amp;PID=10963#10963</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2753<br /><strong>Posted:</strong> 13-Jun-2011 at 1:11pm<br /><br />Hi LawyerDev;<div><br></div><div>There are actually 2 ways to approach this.&nbsp;</div><div><br></div><div>One is to build your own ErrorProvider. Fortunately, here's a link that already provides you with an implementation to get you started.&nbsp;<a href="http://www.codeproject.com/KB/WPF/wpfvalidati&#111;n.aspx#errorProviderCreate" target="_blank">http://www.codeproject.com/KB/WPF/wpfvalidation.aspx#errorProviderCreate</a></div><div><br></div><div>Another way, which, in my opinion, is a cleaner implementation, is to disable the Save button until all validations have passed. You can do this by using CommandBinding.&nbsp;<a href="http://stackoverflow.com/questi&#111;ns/104520/wpf-validati&#111;n-for-the-whole-&#102;orm" target="_blank">http://stackoverflow.com/questions/104520/wpf-validation-for-the-whole-form</a></div><div><br></div><div>Hope this helps.</div>]]>
   </description>
   <pubDate>Mon, 13 Jun 2011 13:11:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2753&amp;PID=10963#10963</guid>
  </item> 
  <item>
   <title>Instance Validation and UI Messages : Greetings,I have developed a WPF...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2753&amp;PID=10930#10930</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1177" rel="nofollow">LawyerDev</a><br /><strong>Subject:</strong> 2753<br /><strong>Posted:</strong> 10-Jun-2011 at 10:00am<br /><br />Greetings,<div><br></div><div>I have developed a WPF MVVM DevForce application with DevForce version 6.1.</div><div><br></div><div>On my main screen, I have many fields where the user enters information. &nbsp;The input fields, textboxes, are binding to DevForce entity properties, which then get saved off to the database. &nbsp;Before I do a save, I do instance validation on the entity. &nbsp;Our business rules are very complex, so I added customer verifiers (often to check for an entered value) for most of the properties in the entity. &nbsp;This is working great. &nbsp;If I leave out a required value, the instance validation catches the violation as it should.</div><div><br></div><div>My issue is with the controls displaying the validation error. &nbsp;The user is entering new information, and so we are creating a new entity and all values are empty. &nbsp;When the user clicks to save the information, and the instance validation is performed, I display a message containing information about each Verifier that failed. &nbsp;However, the errors are not bubbling up to the GUI and the controls. I would like the controls to also display the validation error so the user can see which fields need information. &nbsp;I can get a control to display an error if I enter a value in a required field, click another control, then go back and remove the value. &nbsp;However, if I skip required field and hit save, I then want the control to display the error.</div><div><br></div><div>Our default error notification mode is Notify. &nbsp;The controls have <span ="Apple-style-span" style="font-family: C&#111;nsolas; font-size: 13px; line-height: 18px; white-space: pre; "><span style="color:red;">ValidatesOnDataErrors</span><span style="color:blue;">=</span><span style="color:blue;">true</span></span>&nbsp;and&nbsp;<span ="Apple-style-span" style="font-family: C&#111;nsolas; font-size: 13px; line-height: 18px; white-space: pre; "><span style="color:red;">NotifyOnValidationError</span><span style="color:blue;">=</span><span style="color:blue;">true</span></span>, which works perfectly if they input a value, and then later delete it as I described above. &nbsp;However, it would make sense and would help the user if this also happened when they clicked save and there were required fields with missing data.</div><div><br></div><div>Here is an example of our binding:</div><div><span ="Apple-style-span" style="font-family: C&#111;nsolas; font-size: 13px; line-height: 18px; white-space: pre; "><span style="color:blue;">&lt;</span><span style="color:#a31515;">TextBox</span><span style="color:red;">&nbsp;Name</span><span style="color:blue;">=</span><span style="color:blue;">"txtHomePhone2"</span> </span><span ="Apple-style-span" style="font-family: C&#111;nsolas; font-size: 13px; line-height: 18px; white-space: pre; "><span style="color: red; ">Width</span><span style="color: blue; ">=</span><span style="color: blue; ">"120"</span> </span><span ="Apple-style-span" style="font-family: C&#111;nsolas; font-size: 13px; line-height: 18px; white-space: pre; "><span style="color: red; ">Text</span><span style="color: blue; ">="{</span><span style="color: rgb163, 21, 21; ">Binding</span><span style="color: red; ">&nbsp;Path</span><span style="color: blue; ">=</span><span style="color: blue; ">DebtorPhone2</span><span style="color: blue; ">,</span></span></div><div><span ="Apple-style-span" style="font-family: C&#111;nsolas; font-size: 13px; line-height: 18px; white-space: pre; "></span><span ="Apple-style-span" style="font-family: C&#111;nsolas; font-size: 13px; line-height: 18px; white-space: pre; "><font ="Apple-style-span" color="#0000ff">    </font><span style="color: red; ">ValidatesOnDataErrors</span><span style="color: blue; ">=</span><span style="color: blue; ">true</span><span style="color: blue; ">,&nbsp;</span></span><span ="Apple-style-span" style="font-family: C&#111;nsolas; font-size: 13px; line-height: 18px; white-space: pre; "><span style="color: red; ">NotifyOnValidationError</span><span style="color: blue; ">=</span><span style="color: blue; ">true</span><span style="color: blue; ">}</span><span style="color: blue; ">"</span><span style="color: blue; ">&nbsp;/&gt;</span></span></div><div><br></div><div>And here is an example of a verifier:</div><div><span ="Apple-style-span" style="font-family: C&#111;nsolas; font-size: 13px; line-height: 18px; white-space: pre; "><span style="color:blue;">private</span>&nbsp;<span style="color:blue;">static</span>&nbsp;<span style="color:#2b91af;">VerifierResult</span>&nbsp;Phone2RequiredCondition(<span style="color:#2b91af;">****</span>&nbsp;pTarget,&nbsp;<span style="color:#2b91af;">TriggerContext</span>&nbsp;pTriggerContext,</span></div><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb43, 145, 175; ">VerifierContext</span>&nbsp;pVerifierContext)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">if</span>&nbsp;(pTriggerContext&nbsp;!=&nbsp;<span style="color: blue; ">null</span>&nbsp;&amp;&amp;&nbsp;pTriggerContext.Timing&nbsp;==&nbsp;<span style="color: rgb43, 145, 175; ">TriggerTiming</span>.BeforeSet)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">throw</span>&nbsp;<span style="color: blue; ">new</span>&nbsp;<span style="color: rgb43, 145, 175; ">VerifierException</span>(<span style="color: rgb163, 21, 21; ">"Phone2Required&nbsp;verifier&nbsp;not&nbsp;implemented&nbsp;for&nbsp;Preset"</span>);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">bool</span>&nbsp;isOk&nbsp;=&nbsp;pTarget.RefusedInfo&nbsp;||&nbsp;(!pTarget.RefusedInfo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;&nbsp;!<span style="color: rgb43, 145, 175; ">String</span>.IsNullOrWhiteSpace(pTarget.Phone2));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">return</span>&nbsp;<span style="color: blue; ">new</span>&nbsp;<span style="color: rgb43, 145, 175; ">VerifierResult</span>(isOk);&nbsp;</pre><div><span ="Apple-style-span" style="font-family: C&#111;nsolas; font-size: 13px; line-height: 18px; white-space: pre; ">}</span></div><div><br></div><div>Any help would be appreciated. &nbsp;Thanks.</div>]]>
   </description>
   <pubDate>Fri, 10 Jun 2011 10:00:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2753&amp;PID=10930#10930</guid>
  </item> 
 </channel>
</rss>