Hi again,
Yep, using form-options.
This is the code we had working in 2.0.5
Code:
<form:select path="vaccinationProgrammeItem.vaccineType" multiple="false">
<form:option value="">Text.../form:option>
<form:options items="${vaccinationProgrammeItemForm.vaccineTypes}" itemValue="vaccineTypeId" itemLabel="name" />
</form:select>
This is the work around cod, itemValue is removed. v2.0.7
Code:
<form:select path="vaccinationProgrammeItem.vaccineType" multiple="false">
<form:option value="">Text.../form:option>
<form:options items="${vaccinationProgrammeItemForm.vaccineTypes}" itemLabel="name" />
</form:select>
This is how we register our converter
Code:
@Component("conversionService")
public class ApplicationConversionService extends DefaultConversionService {
@Override
protected void addDefaultConverters() {
super.addDefaultConverters();
// Registers a default converter for VaccineTypeBean type
addConverter(new StringToVaccineType());
}
}
I have debugged the converter and the both the overridden methods are called. during either GET or POST.
Also, i'm guessing the converter should be used when the select is populated. The select does populate nicely. And there is no problem selecting a value and posting it. It ends up in the database.
The problem of getting the correct value selected in select box stays though...
Any help appreciated!