title: JSF getting object from the selectOneMenu
body: <p>I have a problem again with JSF. I am still learning and your help is much apreciated. </p>
  
  <pre><code>&lt;h:form&gt;
      &lt;h:selectOneMenu value="#{productBean.productName}"&gt;
          &lt;f:selectItems value="#{productBean.pizza}" var="pizza" itemValue="#{pizza}" itemLabel="#{pizza.name}" /&gt;
          &lt;f:ajax listener="#{productBean.valueChanged(pizza)}" render="pizzaResult" /&gt;
      &lt;/h:selectOneMenu&gt;
      &lt;h:commandButton value ="Dodaj do zamówienia"/&gt;
      &lt;h:outputText id="pizzaResult" value="#{productBean.message}" /&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>I just want to call the metod valueChanged with the parameter of custom object: Product. This is the method:</p>
  
  <pre><code>public void valueChanged(Product prod)
  {
      if(prod.getIs_available() == 1)
          message = "yes";
      else
          message = "no";
  }
  </code></pre>
  
  <p>I want it to verify if the product is available. And print it in an outputText tag. I think the problem is in HTML because all data reqested are Strings, and I cannot send an Product in such way. Should I use a converter? How it should look like? I don't know much about converters and the working example of ProductConverter will clear my mind.
  THanks in advance.</p>