Hi,
I have an object like so:
public class FormFields extends BaseObject implements Serializable {
private FieldType fieldType; //checkbox, text, radio
private List<FieldValue> value; //FieldValue contains simple string/int information, id, value, label
//other properties and getter/setters
}
I loop through a list of FormFields and if the fieldType does not equal a radio button I am outputting the list of field values in a JSP using
<c:forEach items=${formField.value}></c:forEach>
which is all good and works fine.
Outside of this I have a check for if the fieldType is a radio, in which I use:
<form:radiobuttons path="formFields[${formFieldRow.index}].value" items="${formField.value}" itemLabel="label" cssClass="radio"/>
However this is causing me problems where I get errors like such:
Failed to convert property value of type [java.lang.String] to required type [java.util.List] for property formFields[11].value; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [com.example.model.FieldValue] for property value[0]: no matching editors or conversion strategy found
I've googled this and searched Stack Overflow and found references to registerCustomEditor and similar functions, but I am unsure of how to properly solve this.
Is the custom property editor the way to go with this? If so, how would it work?