hi,

caoyixuan a écrit :
> * Hey,
> I have the following facelets code for display a selectbox:
> * <h:selectOneMenu value="#{titleListManager.selectedTitle}">
> <f:selectItems value="#{titleListManager.titleItems}" />
> </h:selectOneMenu>
> 
> public <List>SelectItem getTitleItems() {

Does this code compile? It should be List<SelectItem> here.

> List<SelectItem> titleItems = new ArrayList<SelectItem>();
> 
> titleItems.add(new SelectItem("1", "1"));
> titleItems.add(new SelectItem("2", "2"));
> titleItems.add(new SelectItem("3", "3"));
> titleItems.add(new SelectItem("4", "4"));
> titleItems.add(new SelectItem("5", "5"));
> 
> return titleItems;
> }
> 
> *Unfortunately, I get the exception below:
> *
> java.lang.IllegalArgumentException: Expected a child component type of
> UISelectItem/UISelectItems for component type
> javax.faces.SelectOne(j_id273). Found null.

The list is not retrieved correctly: #{titleListManager.titleItems} 
resolves to null.
Displaying <h:outputText value="#{titleListManager.titleItems}" /> would 
  be a first step to check that the method is called and actually 
returns the list.

Regards,

-- 
Anahide Tchertchian, Nuxeo
Mail: [EMAIL PROTECTED] - Tel: +33 (0)1 40 33 79 87
http://www.nuxeo.com - http://www.nuxeo.org
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to