3
 <tr>
  <td width="20%"></td>
   <td align="left">
<h:outputText value="#{PeerReviewBean.underwriters}"/>:
   </td>
  <td align="left">
  <h:selectOneMenu id="underwriters" styleClass="selectmedium_dropdown">
         <f:selectItems value="#{PeerReviewBean.underwriters}"/>
                       </h:selectOneMenu> </td> 

I 'm getting the following error in above mentioned code:Expected a child component type of UISelectItem/UISelectItems for component type javax.faces.SelectOne(underwriters). Found null. How can I solve this error?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • `h:selectOneMenu` needs a `value` attribute. Check out [selectOneMenu info page](http://stackoverflow.com/tags/selectonemenu/info). – Elias Dorneles Aug 01 '12 at 13:53
  • @eljunior: that's not required and is also not what the exception suggests. – BalusC Aug 01 '12 at 14:02
  • @BalusC I know that the attribute isn't required, but isn't the result of `value` necessary for conversion to work? – Elias Dorneles Aug 01 '12 at 15:42
  • Duplicates earlier question: http://stackoverflow.com/questions/8008955/jsf-error-expected-a-child-component-type-found-null – Lisa Apr 10 '15 at 06:55

1 Answers1

5

You can get this exception when #{PeerReviewBean.underwriters} in the particular code snippet has returned null. Fix your backing bean code accordingly so that it never returns null.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555