I may be having a duh! moment here, but I'm confused by the behaviour of the CustomNumberEditor when handling a BigDecimal conversion.
I'm registering the CNE under a AbstractWizardFormController.initBinder operation using the following code:
I'm expecting the 3rd constructor arg into CustomNumberEditor (i.e. true) to make it tolerant of null values coming in from the form. However, I'm still getting a typeMismatch String->BigDecimal that does complain about a null value.
NumberFormat managerIdFormat = NumberFormat.getInstance();
binder.registerCustomEditor(BigDecimal.class, "managerId", new, CustomNumberEditor(BigDecimal.class, managerIdFormat, true));
I've tried tests on CNE in a standalone context and it works as expected under test (i.e. happy with "" or null into setAsText). However, it doesn't work as expected in web context.
One thing I note is that, with debug on in Tomcat, the setAsText/getAsText methods on my local copy CNE aren't being called, now this could be a symptom of the problem, but if they aren't being called, then what is.
Hope someone can shed some light. I've had a dig around but cannot find anything that helps.
TIA - John