intuitive feedback for "invalid entity field"

Posts   
 
    
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 07-Jul-2005 15:21:48   

hiya, I am using one of the northwind C# winforms samples. I have hard-coded the returnValue of the customervalidator to false.(to see the default behaviour of llbGenPro when it encounters an invalid element.)

As far as I can see, this means that the "save changes" button is greyed out.

Is there a way to provide the user with more intuitive feedback..I was thinking of something along the lines of a message box?Or maybe I should use an errorProvider in conjunction with the entityValidator?What's everyone else doing?

many thanks, yogi

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 08-Jul-2005 09:39:15   

when a field validator class returns false, the field doesn't get set, so the <PropertyName>Changed event isn't fired and neither is the EntityContentsChanged.

That way, the gui knows if something is actually set or not. The entities don't implement ErrorProvider related interfaces.

Frans Bouma | Lead developer LLBLGen Pro
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 08-Jul-2005 12:21:16   

cheers Frans.

i have been experimenting with the errorProvider.Ideally, I'd like to use this in conjunction with the Validator classes.It seems like a logical way to go, but I might be breaking some of the abstraction that LllbGen provides.

I want to be able to do the following, in order to valid a "customer" entity

<pseudoCode> if _currentCustomer.Validate //do nothing..it is valid else display the errorProvider endif <\pseudoCode>

This code doesn't work..but I am not too concerned with that at the moment. Is anyone using the validator classe in conjunction with the default windows errorProviders?

To re-iterate, I think it's a good idea to give the user some intuitive feedback as to "why" the data the they entered is invalid..

Can anyone comment?

many thanks, yogi