I have a form inside a modal window. A OK button validates the form with the following code:
try {
form.validate();
} catch (Exception ex) {
return;
}
// otherwise process form content
I would expect that if something is invalid an exception would be raised (and shown in component error) and then return upon exception catching. But, for some strange reason this does not happen. So I tried to debug what is going on. I am using Netbeans in a Maven Project (maybe wrong decision, I’ll try Eclipse), and I am unable to trace execution inside Vaadin code. So I tried to insert some statements to understand what was going on. My guess was propertyIds was empty for some reason, so I inserted an extra line to show visible properties:
try {
[b]
form.getVisibleItemProperties().size();
[/b]
form.validate();
} catch (Exception ex) {
return;
}
Now validation is performed, but if I remove the line validation does not work. Any idea of what I am doing wrong?