0 Replies Latest reply on Aug 12, 2008 9:38 AM by L Kr

    NullPointer with rich:pickList

    L Kr Newbie

      Hi,

      I'm just doing the first steps with RichFaces and already have a problem ;(

      I want to use a rich:pickList in my facelets application but always get an NullPointerException:

      Error Rendering View[/presentation/plant_group_demo.xhtml]
      java.lang.NullPointerException
      at com.sun.facelets.util.FastWriter.write(FastWriter.java:77)
      at com.sun.facelets.StateWriter.write(StateWriter.java:116)
      at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.write(HtmlResponseWriter.java:524)
      at org.richfaces.renderkit.PickListRenderer.encodeItem(PickListRenderer.java:194)
      at org.richfaces.renderkit.PickListRenderer.encodeRows(PickListRenderer.java:152)
      at org.richfaces.renderkit.PickListRenderer.encodeSourceRows(PickListRenderer.java:209)
      at org.richfaces.renderkit.html.PickListRendererGen.doEncodeChildren(PickListRendererGen.java:344)
      at org.richfaces.renderkit.html.PickListRendererGen.doEncodeChildren(PickListRendererGen.java:258)
      at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:826)
      at org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChild(RendererUtils.java:414)
      at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:229)
      at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:101)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:850)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
      at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:826)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
      at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)

      ..

      My view looks like:
      <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a="http://www.conergy.com/jsf"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">

      ...

      <t:panelGrid columns="1" border="0" styleClass="plantdatatable">
      <rich:pickList id="picklist2">
      <f:selectItem itemValue="a value" />
      <f:selectItem itemValue="b value" />
      <f:selectItem itemValue="c value" />
      <f:selectItem itemValue="suggestion 1" />
      <f:selectItem itemValue="suggestion 2" />
      <f:selectItem itemValue="suggestion 3" />
      </rich:pickList>
      </t:panelGrid>

      So what I'm doing wrong ?

      Thanks, Lothar