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(ExtensionsFilter.java:122)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.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;
}