I have the following code
public ValidationResult notNull(Control control, String content) {
boolean condition = content.length() <=0;
return ValidationResult.fromMessageIf(control, "Field is empty!", Severity.WARNING, condition);
}
it checks if there is any character in text field,
the i call it like this
validator = new ValidationSupport();
validator.registerValidator(itemIdTf,vals::notNull);
and finally is do this
validator.invalidProperty().addListener((observable, oldValue, newValue) -> {
itemIdTf.pseudoClassStateChanged(PseudoClass.getPseudoClass("negative"), oldValue);});
And this works, it sets the pseudo class for certain controll, how ever when i have few text field controls on same validatior it must wait for all of them to be validated before changing the pseudoclass.
so i thought to perhaps do it in the ValidationResult method, because i think using many validators is probably not good. How ever i dont know if that is possible, i need some listener that is unique to every control, not for validation result.