Am newbie with javafx. Want create simple form with out-of-the-box validation. As library have chosen JideFX. Tried repeat showcase (which is poor for my taste) - http://www.jidesoft.com/jidefx/JideFX_Validation_Developer_Guide.pdf. Have StackOverflowError as result only. Validator is called. Haven’t exception if validation is OK.
Using javafx-8, Java 8, Eclipse Luna, JideFX 0.9.1 (tried 0.9.1-b128 too). Do you have any suggestions? Code is bellow.
SimpleValidator.java
public class SimpleValidator implements Validator {
@Override
public ValidationEvent call(ValidationObject param) {
if (param.getNewValue() != null
&& !param.getNewValue().toString().isEmpty()) {
return ValidationEvent.OK;
} else {
return new ValidationEvent(ValidationEvent.VALIDATION_ERROR, 1,
"Error");
}
}
}
LoginController.java
public class LoginController {
private static final Logger LOGGER = LoggerFactory
.getLogger(LoginController.class);
@FXML
private TextField idField;
//...
@FXML
private void initialize() {
ValidationUtils.install(idField, new SimpleValidator());
}
public LoginController() {
super();
}
//...
}