title: <f:selectItems> only shows toString() of the model as item label
body: <p>I am facing a problem to populate SelectOneMenu correctly using converter. I followed several google references and lastly <a href="http://balusc.blogspot.in/2007/09/objects-in-hselectonemenu.html" rel="nofollow noreferrer">http://balusc.blogspot.in/2007/09/objects-in-hselectonemenu.html</a> link of BalusC. But could not figure out the problem. I am giving all my entity, managedbean and jsf code for your consideration.</p>
  
  <p>Entity:</p>
  
  <pre><code>@Entity
  @Table(name = "gender")
  @XmlRootElement
  @NamedQueries({
      @NamedQuery(name = "Gender.findAll", query = "SELECT g FROM Gender g"),
      @NamedQuery(name = "Gender.findById", query = "SELECT g FROM Gender g WHERE g.id = :id"),
      @NamedQuery(name = "Gender.findByGender", query = "SELECT g FROM Gender g WHERE g.gender = :gender")})
  public class Gender implements Serializable {
      private static final long serialVersionUID = 1L;
      @Id
      @Basic(optional = false)
      @NotNull
      @Column(name = "id")
      private Short id;
      @Size(max = 10)
      @Column(name = "gender")
      private String gender;
      @OneToMany(mappedBy = "gender")
      private List&lt;Patient&gt; patientList;
  
      public Gender() {
      }
  
      public Gender(Short id) {
          this.id = id;
      }
  
      public Short getId() {
          return id;
      }
  
      public void setId(Short id) {
          this.id = id;
      }
  
      public String getGender() {
          return gender;
      }
  
      public void setGender(String gender) {
          this.gender = gender;
      }
  
      @XmlTransient
      public List&lt;Patient&gt; getPatientList() {
          return patientList;
      }
  
      public void setPatientList(List&lt;Patient&gt; patientList) {
          this.patientList = patientList;
      }
  
      @Override
      public int hashCode() {
          return (id != null) ? (getClass().hashCode() + id.hashCode()) : super.hashCode();
      }
  
      @Override
      public boolean equals(Object object) {
          // TODO: Warning - this method won't work in the case the id fields are not set        
          return (object instanceof Gender) &amp;&amp; (id != null) ? id.equals(((Gender) object).id) : (object == this);
      }
  
      @Override
      public String toString() {
          return "hms.models.Gender[ id=" + id + " ]";
      }
  </code></pre>
  
  <p>Converter:</p>
  
  <pre><code>@FacesConverter(value = "genderConverter")
  public class GenderConverter implements Converter {
  
      @Inject GenderService gs;
  
      @Override
      public Object getAsObject(FacesContext context, UIComponent component, String value) {
          if(value == null){
              return null;            
          }
          return gs.getGender(Integer.parseInt(value));
      }
  
      @Override
      public String getAsString(FacesContext context, UIComponent component, Object value) {
          if(value == null) {
              return null;
          }          
          if (!(value instanceof Gender)) {
              throw new ConverterException("The value is not a valid Gender: " + value);
          }
          return ((Gender) value).getGender();
      }
  
  }
  </code></pre>
  
  <p>And JSF SelectOneMenu tag:</p>
  
  <pre><code>&lt;h:selectOneMenu id="gender" value="#{registrationBean.patient.gender}" converter="genderConverter"&gt;
                                          &lt;f:selectItem itemValue="0" itemLabel="-- Select Gender --"  /&gt;
                                          &lt;f:selectItems value="#{registrationBean.genderList}" /&gt;
                                      &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>The dropdown output is similar to "<code>hms.models.Gender[id=1]</code>" and so on. Image sample has given below: </p>
  
  <p><img src="https://i.stack.imgur.com/d34JH.png" alt="enter image description here"></p>
  
  <p>Can anybody help? Thanks in advance.</p>