title: Using enum in selectOneMenu fails with: 'Male' must be convertible to an enum
body: <p>I am about developing a small jsf project and I arrived to a state that I have to store a value in an enumeration type but couldn't figure out how to deal with</p>
  
  <p>so I post here a small description of my problem:</p>
  
  <p>here is the enumeration type:</p>
  
  <pre><code> package com.enumeration;
  
   import java.io.Serializable;
  
  
   public enum Gender implements Serializable{
  
      Male('M'), Female('F');
  
      private char description;
  
     private Gender(char description) {
       this.description = description;
     }
  
     public char getDescription() {
       return description;
     }
  </code></pre>
  
  <p>}</p>
  
  <p>the xhtml page:
         </p>
  
  <pre><code>    &lt;h:panelGrid columns="2"&gt;
                  &lt;h:outputLabel value="Nom:" for="nom" /&gt;
                  &lt;h:inputText id="nom" value="#{employee.newEmployee.nom}" title="Nom" /&gt;
  
                  &lt;h:outputLabel value="Gender:" for="gender" /&gt;
                  &lt;h:selectOneMenu value="#{employeeBean.newEmployee.gender}" id="gender"&gt;
                       &lt;f:selectItem itemLabel="Male" itemValue="Male" /&gt;
                      &lt;f:selectItem itemLabel="Female" itemValue="Female"/&gt;
                  &lt;/h:selectOneMenu&gt;
  
              &lt;/h:panelGrid&gt;
              &lt;h:commandButton value="ajouter" action="index.xhtml" actionListener="#{employeeBean.ajouter}" /&gt;
          &lt;/h:form&gt;
  </code></pre>
  
  <p>the problem is that when I try to add a new row to the database, and error is thrown by jsf:  <strong>j_idt7:gender: 'Male' must be convertible to an enum.</strong> </p>
  
  <p>I did some search on the net but couldn't understand the solutions
  please help
  thanks </p>