aspose file tools*
The moose likes JSF and the fly likes selectOneMenu does not find its child components. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "selectOneMenu does not find its child components." Watch "selectOneMenu does not find its child components." New topic
Author

selectOneMenu does not find its child components.

Jakim Rachev
Greenhorn

Joined: Sep 04, 2010
Posts: 14
He everyone.

From some time now I'm stuck with this exception:
javax.servlet.ServletException: Expected a child component type of UISelectItem/UISelectItems for component type javax.faces.SelectOne(selectCar). Found null.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.IllegalArgumentException: Expected a child component type of UISelectItem/UISelectItems for component type javax.faces.SelectOne(selectCar). Found null.
com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:320)
com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:783)
com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:280)
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:266)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:197)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
org.jboss.
web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


What I'm trying to do i is to populate a combobox with some items from a back been.
Here is my code.

BackBean



Cars.jsp



faces-config fragment



Please help me with this problem. I have also debuged it, and I notices that the get method returns null, but the bean do initialize on every request.
B Nirvan
Ranch Hand

Joined: Oct 20, 2010
Posts: 82
Do you need to declare managed-property in faces-config.xml. Just asking because I never did that. What's the point in declaring the same ?

regards,
Nirvan.
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
I too think that the managed property might be your problem. First you set the values in your constructor (i.e. when the bean is created) but then you say that it should be null with "<value/>" so JSF sets it to null.

Maybe.
Jakim Rachev
Greenhorn

Joined: Sep 04, 2010
Posts: 14
Thanks guys. Tha was the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: selectOneMenu does not find its child components.