f-angi
1/8/2016 - 4:12 PM

Binds radiobuttons to a Map

Binds radiobuttons to a Map

<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>

<c:forEach items="${docsMap}" var="doc">
  <sf:radiobuttons items="${tipoInvioDescriptions}" path="tipoInvioMap['${doc.key}']" ></sf:radiobuttons>
</c:forEach>
  Map<TipoInvio, String> tipoInvioDescriptions = new LinkedHashMap<TipoInvio, String>();
  for (TipoInvio tipoInvio : EnumUtils.getEnumList(TipoInvio.class)) {
      tipoInvioDescriptions.put(tipoInvio, tipoInvio.getDescription());
  }
  
  model.addAttribute("tipoInvioDescriptions", tipoInvioDescriptions);
  public static enum Documenti...
  public static enum TipoInvio...

  private Map<Documenti, TipoInvio> tipoInvioMap;