Re: Model map with enum as a key

2019-02-04 Thread Bas Gooren
Hi! In your first code example you are binding the property model to your config map, using a string key for lookup (“VALUE1”). Since generics in java is mostly syntactic sugar, I think the PropertyModel reads & writes from your config map using a String key. This is why hibernate complains: the

Re: Model map with enum as a key

2019-02-04 Thread Francois Meillet
you are saving the value and not the key, which is why hibernate complains. WHy not choose a DropDownBox ? François > Le 4 févr. 2019 à 14:03, Zbynek Vavros a écrit : > > Do you mean to manually iterate through the map and converting the string > keys > Wicket binds to enum keys? Even if I

Re: Model map with enum as a key

2019-02-04 Thread Zbynek Vavros
Do you mean to manually iterate through the map and converting the string keys Wicket binds to enum keys? Even if I try to iterate through the map I get the same ClassCastException. Somehow Wicket managed to insert String as a key instead of enum. Zbynek On Mon, Feb 4, 2019 at 1:55 PM Francois

Re: Model map with enum as a key

2019-02-04 Thread Francois Meillet
use MyEnum.valueOf("your string ») before saving the data François > Le 4 févr. 2019 à 13:51, Zbynek Vavros a écrit : > > I got this class that has map with enums as keys: > > public class MasterClass { > >private Map config = Maps.newHashMap(); > } > > enum is classic: > > public

Model map with enum as a key

2019-02-04 Thread Zbynek Vavros
I got this class that has map with enums as keys: public class MasterClass { private Map config = Maps.newHashMap(); } enum is classic: public enum MyEnum { VALUE1, VALUE2 } now I would like to use one entry of this map as a model for TextField: new