title: Use enum in h:selectManyCheckbox
body: <p>I want to use enum values in a <code>&lt;h:selectManyCheckbox&gt;</code>. The checkboxes get populated correctly, however, when selecting some values and submitting them, their runtime type is <code>String</code>, and not enum. My code:</p>
  
  <pre><code>&lt;h:selectManyCheckbox value="#{userController.roles}" layout="pageDirection"&gt;
       &lt;f:selectItems value="#{userController.rolesSelectMany}" /&gt;
  &lt;/h:selectManyCheckbox&gt;
  </code></pre>
  
  <p>UserController class (SecurityRole is an enum type):</p>
  
  <pre><code>public SelectItem[] getRolesSelectMany() {
      SelectItem[] items = new SelectItem[SecurityRole.values().length];
  
      int i = 0;
      for (SecurityRole role : SecurityRole.values()) {
          items[i++] = new SelectItem(role, role.toString());
      }
      return items;
  }     
  
  public List&lt;SecurityRole&gt; getRoles() {
       getCurrent().getRoles();
  }
  
  public void setRoles(List&lt;SecurityRole&gt; roles) {
       getCurrent().setRoles(roles);
  }
  </code></pre>
  
  <p>When JSF calls the setRoles method, it contains a list of type String, and not the enum type. Any ideas? Thanks!</p>