Validation
Validation
- Subject: Validation
- From: Alexandre Mainville <email@hidden>
- Date: Thu, 7 Apr 2005 19:31:26 -0400
In a non direct java client application, if "validate immediately" is off on the EODisplayGroup, the user gets a validation error dialog box from a NSValidation.ValidationException.
If I turn on "validate immediately", it seems the property reverts to the last known good value on a validation error. I was expecting to get the dialog box again.
Is this expected behavior? Is there anyway to get the dialog box to show when the user attemps to leave an invalid field? ( I know some people hate this behavior but that's how they want it and he who pays the piper picks the tune...)
Here is the validation method in question:
public Object validateEmail(Object object) throws NSValidation.ValidationException {
String errorMessage = "Invalid email address.";
String emailRegex = "^[a-zA-Z0-9\\._%-]+@[a-zA-Z0-9\\._%-]+\\.[a-zA-Z]{2,4}$";
String s = (String)object;
if(s.matches(emailRegex) == true ) {
// we have a valid email
return s;
}
throw new NSValidation.ValidationException(errorMessage);
}
Thanks
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden