title: JSF Converter issue in SelectOneMenu
body: <p>one more time i'm in trouble here. My point is:
  In my project i need a converter for (obviously) convert the items from the SelectOneMenu component to a list property in the respective bean. In my jsf page i have:</p>
  
  <pre><code>&lt;p:selectOneMenu id="ddlPublicType" value="#{publicBean.selectedPublicType}"    effect="fade" converter="#{publicBean.conversor}" &gt; 
      &lt;f:selectItems value="#{publicoBean.lstPublicTypes}" var="pt" itemLabel="#{pt.label}" itemValue="#{pt.value}"&gt;&lt;/f:selectItems&gt;
  &lt;/p:selectOneMenu&gt;
  </code></pre>
  
  <p>And my bean is:</p>
  
  <pre><code>@ManagedBean(name = "publicBean")
  @RequestScoped
  public class PublicBean {
  
  // Campos
  private String name; // Nome do evento
  private TdPublicType selectedPublicType = null;
  private List&lt;SelectItem&gt; lstPublicTypes = null;
  private static PublicTypeDAO publicTypeDao; // DAO 
  
  static {
      publicTypeDao = new PublicTypeDAO();
  }
  // Construtor
  
  public PublicoBean() {
  
      lstPublicTypes = new ArrayList&lt;SelectItem&gt;();
      List&lt;TdPublicType&gt; lst = publicTypeDao.consultarTodos();
      ListIterator&lt;TdPublicType&gt; i = lst.listIterator();
      lst.add(new SelectItem("-1","Select..."));
      while (i.hasNext()) {
          TdPublicType actual = (TdPublicType) i.next();
          lstPublicTypes.add(new SelectItem(actual.getIdPublicType(), actual.getNamePublicType()));
      }
  
  }
  
  // Getters e Setters
  
  ...
  
  public Converter getConversor() {
      return new Converter() {
          @Override
          public Object getAsObject(FacesContext context, UIComponent component, String value) {
              // This value parameter seems to be the value i had passed into SelectItem constructor
              TdPublicType publicType = null; // Retrieving the PublicType from Database based on ID in value parameter
              try {
                  if (value.compareTo("-1") == 0 || value == null) {
                      return null;
                  }
                  publicType = publicTypeDao.findById(Integer.parseInt(value));
              } catch (Exception e) {
                  FacesMessage msg = new FacesMessage("Error in data conversion.");
                  msg.setSeverity(FacesMessage.SEVERITY_ERROR);
                  FacesContext.getCurrentInstance().addMessage("info", msg);
              }
              return publicType;
          }
  
          @Override
          public String getAsString(FacesContext context, UIComponent component, Object value) {
              return value.toString(); // The value parameter is a TdPublicType object ?
          }
      };
  }
  
  ...
  }
  </code></pre>
  
  <p>In the <strong>getAsObject()</strong> method, the value parameter seems to be the value i had passed into SelectItem constructor. But in the <strong>getAsString()</strong> method, the value also seems to be a string representation of an Id. This parameter shouldn't be of type TdPublicType ? There is anything wrong in my code?</p>