title: ENTITY object in the JSF SelectOneMenu is not working
body: <p>I want to get the instance of the Entity from SelectOneMenu so i can assign the entity variables to some other method. But it is pointing to null.</p>
  
  <h1>xhtml code</h1>
  
  <pre><code>&lt;h:selectOneMenu value="#{statusReport.projectDetID}" converter="ObjectStringConv" onchange="#{statusReport.retrieveReport()}" &gt;
                  &lt;f:selectItems value="#{statusReport.listOfProjectDetail}"
                      var="projectDetail" itemLabel="#{projectDetail.project}              #{projectDetail.startDate}   -    #{projectDetail.endDate}"
                      itemValue="#{projectDetail}" noSelectionValue="Select the Saved Project"/&gt;
              &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>statusReport bean</p>
  
  <pre><code>public class StatusReport implements Serializable {
  
  
      private ProjectDetail projectDetID;
  
      private List&lt;ProjectDetail&gt; listOfProjectDetail;
  
      public List&lt;ProjectDetail&gt; getListOfProjectDetail() {
          listOfProjectDetail = projectDetailFacade.findAll();
          return listOfProjectDetail;
      }
  
      public void setListOfProjectDetail(List&lt;ProjectDetail&gt; listOfProjectDetail) {
          this.listOfProjectDetail = listOfProjectDetail;
      }
      public ProjectDetail getProjectDetID() {
          return projectDetID;
      }
  
      public void setProjectDetID(ProjectDetail projectDetID) {
          this.projectDetID = projectDetID;
      }
  
  
      public void retrieveReport(){
  
          System.out.println(" Processing .....");
          if ( projectDetID == null )
          {
              System.out.println("The object from Select null");
          }
          else
          {
          System.out.println("The object from Select menu" + projectDetID.toString());
          }
  
          System.out.println("Generated Data:Completed");
  
  }}
  </code></pre>
  
  <p>ProjectDetail Entity Bean</p>
  
  <pre><code>package com.jira.entity;
  
  import java.io.Serializable;
  import javax.persistence.*;
  
  import java.util.Date;
  import java.util.List;
  
  
  /**
   * The persistent class for the PROJECT_DETAIL database table.
   * 
   */
  @Entity
  @Table(name="PROJECT_DETAIL",schema="weeklyrep")
  
  public class ProjectDetail implements Serializable {
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="projectdetail_seq")
      @SequenceGenerator(name="projectdetail_seq",schema="weeklyrep",sequenceName="projectdetail_seq", allocationSize=1)
      @Column(name="PDETAIL_ID")
      private long pdetailId;
  
      private Boolean completed;
  
      @Temporal( TemporalType.DATE)
      @Column(name="END_DATE")
      private Date endDate;
  
      private Long project;
  
      @Temporal( TemporalType.DATE)
      @Column(name="START_DATE")
      private Date startDate;
  
      //bi-directional many-to-one association to MajorEvent
      @OneToMany(mappedBy="projectDetail",cascade=CascadeType.ALL)
      private List&lt;MajorEvent&gt; majorEvents;
      //bi-directional one-to-one association to ExecSummary
      @OneToOne(mappedBy="projectDetailExec",cascade=CascadeType.ALL)
      private ExecSummary execSummary;
      public ProjectDetail() {
      }
  
      public long getPdetailId() {
          return this.pdetailId;
      }
  
      public void setPdetailId(Long pdetailId) {
          this.pdetailId = pdetailId;
      }
  
      public Boolean getCompleted() {
          return this.completed;
      }
  
      public void setCompleted(Boolean completed) {
          this.completed = completed;
      }
  
      public Date getEndDate() {
          return this.endDate;
      }
  
      public void setEndDate(Date endDate) {
          this.endDate = endDate;
      }
  
      public long getProject() {
          return this.project;
      }
  
      public void setProject(long project) {
          this.project = project;
      }
  
      public Date getStartDate() {
          return this.startDate;
      }
  
      public void setStartDate(Date startDate) {
          this.startDate = startDate;
      }
  
      public List&lt;MajorEvent&gt; getMajorEvents() {
          return this.majorEvents;
      }
  
      public void setMajorEvents(List&lt;MajorEvent&gt; majorEvents) {
          this.majorEvents = majorEvents;
      }
  
      public ExecSummary getExecSummary() {
          return execSummary;
      }
  
      public void setExecSummary(ExecSummary execSummary) {
          this.execSummary = execSummary;
      }
  
  
  }
  </code></pre>
  
  <p>Converter</p>
  
  <p>I don't know if it needs converter, however i don't know how code it.</p>
  
  <pre><code>package com.weeklyreport.converters;
  
  import javax.faces.component.UIComponent;
  import javax.faces.context.FacesContext;
  import javax.faces.convert.Converter;
  import javax.faces.convert.FacesConverter;
  
  import com.jira.entity.ProjectDetail;
  
  
  @FacesConverter(value="ObjectStringConv")
  public class ObjectStringConv implements Converter {
  
      @Override
      public Object getAsObject(FacesContext context, UIComponent component, String svalue) {
          System.out.print("String version of object is:" + svalue);
          return "test";
      }
  
      @Override
      public String getAsString(FacesContext context, UIComponent component, Object ovalue) {
  
              return ovalue.toString();
          }
  
      }
  </code></pre>
  
  <p>Please help me figure this out. Is there a way we get instance of the entity object like this?</p>