Jun 19th, 2009, 02:26 PM
Challenging Converter and Array problem, possible bug?
So I have done some reading through the forum and reference material but I don't think any of them are quite the same problem I have.
I have a form that has 4 checkboxes with the same name threw them into a string array and everything was happy. Correct values are there, when the page is viewed again checkboxes that should be selected are selected.
I created a custom coverter for my new object I want to through the values into.
1. It will work when only one checkbox is selected but as soon as more than one is selected it refreshes the page no exceptions or messaging of any kind is thrown.
2. Even when one is select successfully it does not select that item when the page is in view again. Previously with just the string this worked.
Shouldn't my object array react the same way as my string array given it has a converter registered? I use this object with the converter on some of my other form fields and it works perfectly. Could this be a bug in SWF?
Jul 7th, 2009, 04:47 AM
I have the same problem, only with multiselects.
Works fine with a converter from String to whatever my object type is when a single value is selected, but with several values selected a String array is passed to the converter, and a ConversionExecutionException is thrown:
org.springframework.binding.convert.ConversionExec utionException: Source object [Ljava.lang.String;@2e6d14 to convert is expected to be an instance of [java.lang.String], originalValue = array<String>['1', '2']
I've ended up doing the conversion in my service layer instead, but that shouldn't be necessary..