We have an input form with a number of input fields, 2 of them need to be validated in such a way that one can be blank on submit but not both.
So I need a custom validator for each field that checks if the value is blank and if it is blank check if the other field is also blank.
I have the custom validator working for the control testing for a specific value, but when I test for a blank or null string it won’t work.
Examples:
The following works and the exception is thrown as expected when I type “test” into the control and click submit.
if (value.toString().equalsIgnoreCase("test"))
But I have tried many different things to get it to test for a blank/null string and can’t get it to work:
if (value == null)
if (value.toString().equalsIgnoreCase("")
if (StringUtils.isBlank(value.toString())
if (value.toString().length() == 0)
Any help would be greatly appreciated.
#MWS-CAF-Task-Engine#webMethods#webMethods-BPMS