You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Jeffrey Porter <PO...@WMGMAIL.wmg.warwick.ac.uk> on 2005/10/31 15:24:56 UTC
selectOneListbox - does not contain Objects of type SelectItem?!?
Hello all again,
I presume that I'm having another blonde moment (a moment of stupidity).
I'm getting the following exception, but I can't see why.
I'm giving it an ArrayList of SelectItem objects, but still it fails.
Anyone got any ideas?
Thanks again
Jeff.
javax.servlet.ServletException: Collection referenced by UISelectItems
with binding '#{myObject.subCategories}' and Component-Path :
{Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId:
/attachPIR.jsp][Class: javax.faces.component.html.HtmlPanelGroup,Id:
body][Class: javax.faces.component.html.HtmlForm,Id: _id0][Class:
javax.faces.component.html.HtmlSelectOneListbox,Id: _id80][Class:
javax.faces.component.UISelectItems,Id: _id81]} does not contain Objects
of type SelectItem
javax.faces.webapp.FacesServlet.service(FacesServlet.java:109)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(Extensi
onsFilter.java:122)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
r.java:81)
JSP...
<h:selectOneListbox value="#{myObject.subCategory}" >
<f:selectItems value="#{myObject.subCategories}"/>
</h:selectOneListbox>
CODE...
import javax.faces.model.SelectItem;
public List getSubCategories() {
subCategories = new ArrayList();
SelectItem item = new SelectItem("subcategory");
subCategories.add(item);
return subCategories;
}