New Posts New Posts RSS Feed: Property Level HasErrors property...
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Property Level HasErrors property...

 Post Reply Post Reply
Author
as123 View Drop Down
Newbie
Newbie


Joined: 27-Apr-2010
Posts: 30
Post Options Post Options   Quote as123 Quote  Post ReplyReply Direct Link To This Post Topic: Property Level HasErrors property...
    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

Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post 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 DevForce Resource Center and also find more information about the INotifyDataErrorInfo and the EntityWrapper in our API Documentation online. (also installed with DevForce)
 
Regards,
   Silvio.
Back to Top
as123 View Drop Down
Newbie
Newbie


Joined: 27-Apr-2010
Posts: 30
Post Options Post Options   Quote as123 Quote  Post ReplyReply Direct Link To This Post Posted: 17-Feb-2011 at 5:14pm
         Thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down