1 Reply Latest reply on Sep 9, 2009 5:20 PM by Gus Gu

    Using Enums with HashMaps and xhtml access

    I need a real name Newbie
      Hi, I am having trouble accessing a map from xhtml that contains an Enum type as key. Since Seam can convert enums to strings I assumed going the other direction, String -> Enum conversion would work also, however I am not able to use it. Example code:

        public enum MyType { ONE, TWO }
       
        public Map<MyType, String> getTest() {
          Map<MyType, String> m = new HashMap<MyType, String>();
          m.put(MyType.ONE, "3333");
          return m;
        }`

      On xhtml

        #{obj.test['ONE']}

      This displays null. If I change the key type MyEnum to a String, things work fine. Any suggestions?