Hi all,
I have been using Spring RCP for 3 years, but I have just realized a rare behaviour:
"Binding error messages are not clear after reseting a form"
The reason is that the unique class responsible for clearing "bindingErrorMessages" property (ValidatingFormValueModel) is not aware of form object changed action (however BufferedValueModel throw its commit trigger is aware).
Do you have any idea? Perhaps DefaultFormModel#setFormObject should clear binding errores messages.
This simple test demonstrates this failure (PersonChildForm is a very simple form with an "age" number property):
Thank you very much!Code:final PersonChildForm form = new PersonChildForm(); // After executing new form object command validation messages are empty form.getNewFormObjectCommand().execute(); Assert.assertEquals(0, form.getFormModel().getValidationResults().getMessageCount()); // Set a illegal age and a validation error is raised form.getAgeControl().setText("Illegal Value"); Assert.assertEquals(1, form.getFormModel().getValidationResults().getMessageCount()); // Execute the reset command and the count backs to 0 form.reset(); Assert.assertEquals(0, form.getFormModel().getValidationResults().getMessageCount()); // After executing new form object command the count backs to 1!! form.getNewFormObjectCommand().execute(); Assert.assertEquals(0, form.getFormModel().getValidationResults().getMessageCount());


Reply With Quote
