Open spring-operator opened 13 years ago
Peter Tang commented
When trying to convert, the assert line of GenericConversionService below fails:
Assert.isTrue(source == null || sourceType.getObjectType().isInstance(source));
Peter Tang commented
I should have created this ticket with a higher priority. Is there a way to change it. When do you think you can take a look at it, confirm it is an issue?
Thanks, Peter.
Rossen Stoyanchev commented
Would you be able to reproduce the issue at the Spring Web Flow issue github repo? There are instructions and template projects to make it as easy as possible.
Peter Tang commented
Sure I'll give it a try.
Rossen Stoyanchev commented
I've started a project at the issue repository. It contains the code mentioned but does not yet reproduce the issue. Can you take a look and add what's missing? You can fork the repository, modify the project, and send a pull request. If you can help demonstrate the issue we can consider it for 3.1.1 or otherwise it'll have to be postponed.
Peter Tang commented
It's because MyType is supposed to be a class with a custom converter. Will try and update with an example but not sure I will get to it before 3.1.1 also.
Thanks.
Rossen Stoyanchev commented
That would be great, thanks. You meant before 2.3.1 I think.
Rossen Stoyanchev commented
Postponing to allow more time to reproduce the issue.
Sebastian Stenzel commented
Issue still exists with spring-webflow 2.3.1 for any type of Collection. The problem lies in the following code section (org.springframework.webflow.mvc.view.BindingModel:274):
if (valueType != null) {
BeanWrapper accessor = PropertyAccessorFactory.forBeanPropertyAccess(boundObject);
TypeDescriptor typeDescriptor = accessor.getPropertyTypeDescriptor(field);
return new ConvertingPropertyEditorAdapter(conversionService, converterId, typeDescriptor);
}
Even though the correct type ("valueType") is supplied, it is not used to create the ConvertingPropertyEditorAdapter.
Peter Tang opened SWF-1495 and commented
The Binding model cannot find proper converting property editor when binding to an array of custom type.
The 'findSpringConvertingPropertyEditor' method of BindingModel finds a TypeDescriptor of types.CustomType[] when perhaps it should be types.CustomType?
this occurs when trying to bind multiple checkboxes to an array property.
ex. Model:
View - jsp file
Notes: The value option prints out the toString() method of the MyType class (because it cannot find the proper converter) The same model/jsp and converters bind properly when using the Spring MVC binder. The converter works because using a hidden input tag will bind properly if oneSelected is a field of type MyType.
Affects: 2.3.0
4 votes, 4 watchers