myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Rossi (JIRA)" <>
Subject [jira] [Created] (MYFACES-3304) NullPointerException using h:selectOneRadio with an enum
Date Sat, 10 Sep 2011 17:51:08 GMT
NullPointerException using h:selectOneRadio with an enum

                 Key: MYFACES-3304
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 2.0.8
         Environment: Ubuntu 11.0.4, Jetty 6.1.10, JDK 1.6, Myfaces Core 2.0.8, Primefaces
            Reporter: Joe Rossi
            Priority: Minor

Trying to use a h:selectOneRadio to select one of two values for an enum and it fails, throwing
a NullPointerException. No explicit converter is in use so (from debugging) it appears to
be using the default EnumConverter.

Code snippets in question are as follows:


    <h:panelGrid columns="1">

      Simple radio button with constant string values
      <h:selectOneRadio id="l1" value="#{testLovsBean.l1}">
         <f:selectItem itemValue="A" itemLabel="labelA"/>
         <f:selectItem itemValue="B" itemLabel="labelB"/>
      <h:outputText id="l1Str" value="l1: #{testLovBean.l1AsString}"/>


      Radio button for enum
      <h:selectOneRadio id="l2" value="#{testLovsBean.l2}">
         <f:selectItem itemValue="#{VALUEA}" itemLabel="labelA"/>
         <f:selectItem itemValue="#{VALUEB}" itemLabel="labelB"/>
      <h:outputText id="l2Str" value="l2: #{testLovBean.l2AsString}"/>


      <p:commandButton id="commitCommand"

package tn.view.bean.test;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import tn.view.util.FacesUtils;

 * Class used for testing date controls
public class TestLovsBean
  public TestLovsBean()

  public String getL1()
    return _l1;

  public void setL1(String l1)
    _l1 = l1;

  public String getL1AsString()
    return _l1;

  public TestEnum getL2()
    return _l2;

  public void setL2(TestEnum l2)
    _l2 = l2;

  public String commitAction()
    System.out.println("commitAction invoked");
    FacesUtils.addInfoMessage("L1: " + _l1);
    FacesUtils.addInfoMessage("L2: " + _l2);
    return null;

  private String _l1;
  private TestEnum _l2;

package tn.view.bean.test;

public enum TestEnum

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message