NullPointerException in renderer for SelectOneMenu

UI Components for JSF
Post Reply
Alan
Posts: 102
Joined: 25 Oct 2010, 04:45

07 Sep 2011, 00:11

This is on PF 3.0.M3. The facelet is this:

Code: Select all

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>
        <ui:composition template="./template.xhtml">
            <ui:define name="content">
                <h1>Page To Test Stuff</h1>

                <p>Now we are testing time zone input </p>

                <h:form id="testForm" >

                    <h:panelGrid columns="2" >
                        <h:outputText value="Time Zone:"  />
                        <p:selectOneMenu value="#{test.testValue}">  
                            <f:selectItem itemValue="AET" />
                            <f:selectItem itemValue="AGT" />
                            <f:selectItem itemValue="ART" />
                            <f:selectItem itemValue="AST" />
                            <f:selectItem itemValue="Africa/Abidjan" />
                            <f:selectItem itemValue="Africa/Accra" />
                                 <!-- about 600 selectItem elements omitted -->
                            <f:selectItem itemValue="WET" />
                            <f:selectItem itemValue="Zulu" />
                        </p:selectOneMenu>
                    </h:panelGrid>
                    
                    <h:commandButton value="Do it" action="#{test.doNothng}" />                                   

                    <br/>
                    Value is: <h:outputText id="ooga" value="#{test.testValue}" />
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
The test bean's testValue property is a String. When attempting to render the page I get this:

Code: Select all

java.lang.NullPointerException
	at org.primefaces.component.selectonemenu.SelectOneMenuRenderer.encodeLabel(SelectOneMenuRenderer.java:117)
	at org.primefaces.component.selectonemenu.SelectOneMenuRenderer.encodeMarkup(SelectOneMenuRenderer.java:76)
	at org.primefaces.component.selectonemenu.SelectOneMenuRenderer.encodeEnd(SelectOneMenuRenderer.java:53)
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
	at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312)
	at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
	at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
	at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
       (etc)
What broke, me or it?
Netbeans 7.1, GlassFish 3.1.1, MacOS X 10.6.8, Safari, Firefox

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 58 guests