Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 3 weeks ago
setValidationVisible not working
Hi guys,
I am using TextFields with setRequired(true) and setValidationVisible(true) inside a Window. The validation is well catched durring the validate() call but the setValidationVisible(true) doesn't seem to work. There is no red outline on my TextField and the "v-textfield-error" is not added to the component class.
I am using it exactly the same way in a other view but without window and it is working properly.
Note : I am using the delarative syntax.
Here is my code :
feedWindowRoot.textFieldName.setRequired(true);
feedWindowRoot.textFieldName.setValidationVisible(true);
feedWindowRoot.buttonSave.addClickListener(new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent event) {
try {
feedWindowRoot.textFieldName.validate();
}
catch (Validator.InvalidValueException e) {
feedWindowRoot.textFieldName.setValidationVisible(true);
Notification.show("This field is required");
}
});
Any idea ?
Thank you
Last updated on
You cannot reply to this thread.