View Full Version : Custom-Complex validation
Jurijus Jarmakas
Jan 12th, 2005, 08:25 PM
How to handle situation if validation requires complex data processing. Is there a way to push an error into dialog message/error area "manually"?
oliverhutchison
Jan 12th, 2005, 08:46 PM
Jurijus,
we may be able to help you better if you could you let us know what exactly are you trying to do? What's unsatisfactory about using Constraints?
Ollie
Jurijus Jarmakas
Jan 12th, 2005, 09:37 PM
I am updating a record, one of the updatable values is part of the index (combobox), I have to make sure that the user does not select the value which would cause duplicate index. I have to loop through all the records to see that there is no duplicate, and this validation should occur upon button click.
oliverhutchison
Jan 12th, 2005, 09:43 PM
I'm not sure I follow what you're describing. Couldn't you just provide a PropertyConstraint that checks for "duplicate index"?
Could you provide a bit of code to illustrate the case some more.
Jurijus Jarmakas
Jan 12th, 2005, 10:12 PM
so, I will create my own constraint like
public class MyCustomConstraint extends TypeResolvableConstraint {
public MyCustomConstraint() {
super("customConstraint");
}
public boolean test(Object argument) {
// implementation of constraint
}
}
and the "test" method will have my data validation logic?
oliverhutchison
Jan 12th, 2005, 10:44 PM
Exactly. ;-)
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.