if you just have a FormLayout, you need to validate the fields manually. Something like this:
public void onSave() {
for (Field f : referencesToYourFields) {
try {
f.validate();
} catch (InvalidValueException e) {
// show error message etc.
return;
}
}
// Do the actual submit
}
If you would use either Form or FieldGroup with your fields, you can get this functionality done automatically by the framework.