Display alert dialog on user interface from custom java validation
Hello everyone!
I've made a custom validation class on Promotion Request Wizard to allow only 1 Object to be promoted.
On my implementation of DefaultUIComponentValidator, the method performFullPreValidation(UIValidationKey arg0, UIValidationCriteria arg1, Locale arg2) throws a WTException when validation not met the requirements, but the message on Exception do not show to the final user, just appear on console.
What's happening? Am I missing something? What's the correct way to display exception message to the final user through alert dialog?
This is the implementation:
public UIValidationResultSet performFullPreValidation(UIValidationKey arg0, UIValidationCriteria arg1, Locale arg2) throws WTException {
if(arg1.getTargetObjects().size() == 1) {
return super.performFullPreValidation(arg0, arg1, arg2);
} else if(arg1.getTargetObjects().size() > 1) {
throw new WTException("Only one object allowed for promotion");
} else {
throw new WTException("Need to select one object for promotion");
}
}


