How I can bind a collection to a form for inputdata (not for show)
+1
A:
e.g. for a Set<Jokers>
protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
binder.registerCustomEditor(
Set.class,
"[nameOfTheClassMemberItShouldGoto]",
new CustomCollectionEditor(Set.class) {
protected Object convertElement(Object element) {
return (element == null ? null : getQueryService().getJoker(element.toString()));
}
}
);
}
or similar to this
jitter
2009-11-05 16:59:58
A:
But I want to add elemento to the set using a form, I don't known how to do it
mathyas
2009-11-09 16:20:39
A:
I did the same question and got a nice solution, take a look here http://stackoverflow.com/questions/3283920/how-to-bind-a-list-of-object-to-springmvc-controller
Guilherme Oenning
2010-10-11 12:20:20