title: h:selectOneMenu with boolean items doesn't work with null value
body: <p>I'm working with JSF 2.0, JBoss 7.1.1 Final and I have following problem with selectOneMenu. I want to be able to set a field in a managed bean to true/false/null. Thus, I have created following selectOneMenu:</p>
  
  <pre><code>&lt;h:selectOneMenu value="#{personList.criteria.registrationComplete}" &gt;
      &lt;f:selectItem itemValue="#{null}" itemLabel="Any.." /&gt;
      &lt;f:selectItem itemValue="true" itemLabel="Yes"/&gt;
      &lt;f:selectItem itemValue="false" itemLabel="No"/&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>Now, If I choose to 'Any..', it will assign "false" to the registrationComplete field (which is Boolean). So <strong>null is interpreted as false</strong>. I also tried to use boolean values in the selectItem(s), that is:</p>
  
  <pre><code> &lt;h:selectOneMenu value="#{personList.criteria.registrationComplete}" &gt;
      &lt;f:selectItem itemValue="#{null}" itemLabel="Any.." /&gt;
      &lt;f:selectItem itemValue="#{true}" itemLabel="Yes"/&gt;
      &lt;f:selectItem itemValue="#{false}" itemLabel="No"/&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>And I also registered converter in faces-config as follows:</p>
  
  <pre><code>&lt;converter&gt;  
      &lt;converter-id&gt;booleanConverter&lt;/converter-id&gt;  
      &lt;converter-class&gt;javax.faces.convert.BooleanConverter&lt;/converter-class&gt;  
  &lt;/converter&gt;
  </code></pre>
  
  <p>and tried to use it:</p>
  
  <pre><code>&lt;h:selectOneMenu value="#{personList.criteria.registrationComplete}" &gt;
      &lt;f:selectItem itemValue="#{null}" itemLabel="Any.." /&gt;
      &lt;f:selectItem itemValue="true" itemLabel="Yes"/&gt;
      &lt;f:selectItem itemValue="false" itemLabel="No"/&gt;
          &lt;f:converter converterId="booleanConverter"/&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>But all these attempts resulted in the same behavior -- <strong>when the null value was selected, it was interpreted as false.</strong> </p>
  
  <p>I debugged it and in the stack trace I found the location where it happens. In <code>AstValue.setValue(EvaluationContext, Object) line: 204</code> </p>
  
  <p>it calls </p>
  
  <pre><code>ELSupport.coerceToType(value, targetClass)
  </code></pre>
  
  <p>value parameter is null and targetClass is Boolean. This coerceToType method then returns false.</p>
  
  <p>Any ideas how to solve this issues? Thanks!</p>