SpringMVC how to Bind Multi Select Options When Form Is Returned From Controller
posted 3 years ago
I have four select option list two are populated with data form the database and two are multi selects which are bind to the POJO. I then use java script to add options form the database select option list into the bind select option list however when i submit to the controller if the form is returned with errors and the select option list have data in it the data is lost.
The list items are both getting data properly only when the form is posted to the controller if the validation finds any errors and returns the form if these fields had data its lost.
I saw based on some research i need to register a custom binder but i am not sure how to write a binder for just the two fields (criminals and victims) and how do i populate the list to be returned