Print Page | Close Window

Property Level HasErrors property...

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2503
Printed Date: 18-Apr-2025 at 12:46am


Topic: Property Level HasErrors property...
Posted By: as123
Subject: Property Level HasErrors property...
Date Posted: 11-Feb-2011 at 11:18am

            When multiple verifiers are attached to a single property, is there a way to accumulate the results at the individual property level and see whether everything succeeded?

 

            For example, let us say I have ID and Name properties on an entity, and each of them has 5 verifiers. Now, if I need to know whether ID is valid (after executing all the 5 verifiers) as part of the Business logic, do I need to go through the verifier result collection and check the results? Is there any DevForce property specifying whether each Entity Property is valid, similar to HasErrors on the Instance?

 

Thanks




Replies:
Posted By: sbelini
Date Posted: 17-Feb-2011 at 5:12pm

Hi as123,

You can check the property for validation errors by using the GetErrors(propertyName) method:
 
var idErrors = ((INotifyDataErrorInfo)employee).GetErrors(Employee.PropertyMetadata.Id.Name);
 
The GetErrors method is a member of the INotifyDataErrorInfo interface which is implemented by the EntityWrapper.
 
You can find valuable information about this topic in our http://drc.ideablade.com/xwiki/bin/view/Documentation/Verification-in-the-User-Interface - DevForce Resource Center and also find more information about the INotifyDataErrorInfo and the EntityWrapper in our http://drc.ideablade.com/ApiDocumentation/webframe.html - API Documentation online. (also installed with DevForce)
 
Regards,
   Silvio.


Posted By: as123
Date Posted: 17-Feb-2011 at 5:14pm
         Thanks.



Print Page | Close Window