2 Replies Latest reply on May 15, 2007 7:55 AM by Gustavo Teixeira

    empty option with convertEnum

    Gustavo Teixeira Newbie

      I´m getting a ClassCastException when I using a empty option in a selectOneMenu. Does anybody can help me?

      Thanks in advance!


      java.lang.ClassCastException: java.lang.String
       at org.jboss.seam.ui.EnumConverter.getAsString(EnumConverter.java:28)
       at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.
      java:469)


      <h:selectOneMenu value="#{politicapublica.classificacao}">
       <f:selectItem itemValue="" itemLabel=" " />
       <s:convertEnum enumClass="myEnumClass" />
       <s:enumItem enumValue="FISCAL" label="FISCAL" />
       <s:enumItem enumValue="SEGURIDADE" label="SEGURIDADE" />
      </h:selectOneMenu>