<?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 : Client side validation</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : Community Forum : Client side validation</description>
  <pubDate>Tue, 12 May 2026 19:35:06 -700</pubDate>
  <lastBuildDate>Thu, 15 Mar 2012 00:15:35 -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=3332</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>Client side validation :   Hello,I&amp;#039;ve adopted an...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3332&amp;PID=12988#12988</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1136" rel="nofollow">pponzano</a><br /><strong>Subject:</strong> 3332<br /><strong>Posted:</strong> 15-Mar-2012 at 12:15am<br /><br />Hello,<div>I've adopted an hybrid approach</div><div>here's what I did</div><div>&nbsp;</div><div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;">&#091;<span style="color: rgb43, 145, 175;">DataContract</span>&#093;</p><p style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: rgb43, 145, 175;">OperazioneInsert</span> : <span style="color: rgb43, 145, 175;">INotifyPropertyChanged</span>, <span style="color: rgb43, 145, 175;">IDataErrorInfo</span></p><p style="margin: 0px;">{</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> OperazioneInsert()</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ListaErrori = <span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;">ObservableCollection</span>&lt;<span style="color: blue;">string</span>&gt;();</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ListaErrori.CollectionChanged += (sender, e) =&gt; OnPropertyChanged(<span style="color: rgb163, 21, 21;">"ListaErrori"</span>);</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; }</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: rgb43, 145, 175;">ObservableCollection</span>&lt;<span style="color: blue;">string</span>&gt; ListaErrori { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">bool</span> HasError</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">get</span> { <span style="color: blue;">return</span> ListaErrori.Any(); }</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; }</p><div>&#091;...&#093;</div><div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">string</span> Error</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">get</span> { <span style="color: blue;">return</span> <span style="color: blue;">string</span>.Empty; }</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; }</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">string</span> <span style="color: blue;">this</span>&#091;<span style="color: blue;">string</span> columnName&#093;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">get</span></p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p><div><span style="color: blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> error = <span style="color: blue;">string</span>.Empty;</div><div><!--EndFragment-->&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;logic for checking error on item</div><div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;"><span style="color: blue;">default</span>:</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <span style="color: blue;">return</span> <span style="color: blue;">string</span>.Empty;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; }</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <span style="color: blue;">if</span> (!<span style="color: blue;">string</span>.IsNullOrEmpty(error))</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <span style="color: blue;">if</span> (!ListaErrori.Contains(columnName))</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; ListaErrori.Add(columnName);</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; }</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <span style="color: blue;">else</span></p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <span style="color: blue;">if</span> (ListaErrori.Contains(columnName))</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; ListaErrori.Remove(columnName);</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; }</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <span style="color: blue;">return</span> error;</p></div><!--EndFragment-->&#093;</div></div><!--EndFragment--></div><div>&nbsp;</div>}</div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;">&nbsp;</div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;">In the viewmodel I check if there's an error... btw my preferred approach is DataAnnotation but I'm not able to get it to work</div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;">&nbsp;</div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;">&nbsp;</div><!--EndFragment--></div>]]>
   </description>
   <pubDate>Thu, 15 Mar 2012 00:15:35 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3332&amp;PID=12988#12988</guid>
  </item> 
  <item>
   <title>Client side validation :   You are better off adding...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3332&amp;PID=12980#12980</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3332<br /><strong>Posted:</strong> 14-Mar-2012 at 9:56am<br /><br />You are better off adding a boolean property to your object that indicates whether it has validation errors or not. IDataErrorInfo doesn't lend itself for this task.]]>
   </description>
   <pubDate>Wed, 14 Mar 2012 09:56:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3332&amp;PID=12980#12980</guid>
  </item> 
  <item>
   <title>Client side validation :   Hello Marcel,in my testing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3332&amp;PID=12963#12963</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1136" rel="nofollow">pponzano</a><br /><strong>Subject:</strong> 3332<br /><strong>Posted:</strong> 13-Mar-2012 at 1:08am<br /><br />Hello Marcel,<div>in my testing I did so, but I've got a problem... I need to disable the ok button based on if there're validation error.... using IDataError info, how do I check if there're error?</div>]]>
   </description>
   <pubDate>Tue, 13 Mar 2012 01:08:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3332&amp;PID=12963#12963</guid>
  </item> 
  <item>
   <title>Client side validation :   I forget if you are doing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3332&amp;PID=12961#12961</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3332<br /><strong>Posted:</strong> 12-Mar-2012 at 7:32pm<br /><br />I forget if you are doing WPF or Silverlight, but you'll have to implement IDataErrorInfo (WPF) or INotifyDataErrorInfo (Silverlight) in the POCO. You also have the option of simply throwing exceptions in your setters and set ValidatesOnExceptions to true in the binding. Neither DevForce nor Cocktail currently provides anything&nbsp;that helps you with implementing validation in your own POCOs. This is something we are considering, but at the moment you'll have to implement it yourself.&nbsp;]]>
   </description>
   <pubDate>Mon, 12 Mar 2012 19:32:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3332&amp;PID=12961#12961</guid>
  </item> 
  <item>
   <title>Client side validation : Hello,I&amp;#039;ve got an object...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3332&amp;PID=12955#12955</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1136" rel="nofollow">pponzano</a><br /><strong>Subject:</strong> 3332<br /><strong>Posted:</strong> 12-Mar-2012 at 3:21am<br /><br />Hello,<br>I've got an object I share between client/server defined as<br><br>&#091;DataContract&#093;<br>public class TestClass<br>{<br>&#091;DataMember&#093;<br>public int ID {get;set;}<br>&#091;DataMember&#093;<br>public string&nbsp; Description {get;set;}<br>&#091;DataMember&#093;<br>public decimal Value{get,set;}<br>}<br><br>I've it defined in a viewmodel I use to insert this kind of data <br><br>public class MyViewModel : Screen<br>{<br>public TestClass myTestClass<br>{<br>get<br>{<br>return _myTestClass<br>}<br>set<br>{<br>_myTestClass = value;<br>...<br>}<br>}<br>}<br><br>how can I validate this object ? I've done other validation using the method proposed at http://www.lyquidity.com/devblog/?p=71 but I've not the single properties in my viewmodel, just the poco object<br><br>Thanks<br>]]>
   </description>
   <pubDate>Mon, 12 Mar 2012 03:21:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3332&amp;PID=12955#12955</guid>
  </item> 
 </channel>
</rss>