i\'m using the jQuery UI datepicker instead of the
, which is changing the selected date in a textbox. Now I want to save this neatly back into
There shouldn't be that much magic.
resources.groovy
beans = {
customPropertyEditorRegistrar(CustomPropertyEditorRegistrar)
}
src/groovy/{yourpackage}/CustomPropertyEditorRegistrar.groovy
class CustomPropertyEditorRegistrar implements PropertyEditorRegistrar {
@Override
void registerCustomEditors(PropertyEditorRegistry registry) {
// Always set the nullable to true and handle not nullable fields through constraints
registry.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("dd.MM.yyyy"), true));
}
}