1 Reply Latest reply on Jun 29, 2007 7:48 AM by Pete Muir

    Problem with s:convertEnum

    Magnus Sandberg Novice

      When I post an enum-value value using the s:convertEnum I just end up with:

      java.lang.IllegalArgumentException: java.lang.Object is not an enum type
       at java.lang.Class.enumConstantDirectory(Class.java:2965)
       at java.lang.Enum.valueOf(Enum.java:187)
       at org.jboss.seam.ui.EnumConverter.getAsObject(EnumConverter.java:17)
       at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:152)
       at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectOneValue(MenuRenderer.java:197)
       at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(MenuRenderer.java:359)
      


      In EnumConverter "getExpectedType()".

      Class enumType = comp.getValueExpression("value").getExpectedType();


      does not return the enum type but Class. The valueExpr in the Binding is correct and the get/set-pair is using the correct enum-type.

      Any idea why this happens?