-
1. Re: SelectManyCheckbox
sunfire Apr 9, 2006 7:16 AM (in response to mirko27)I am not sure about this and realy like to hear Gavins opinion on my response:
These attributes occur on component instance variables or property
This is taken from the manual for bijection annotations and I take it that bijection annotations only work for Seam components and not for regular types like Map or String?
accessor methods
So I guess you have to wrap your datamap with some get and set methods and access it in your jsf like this<f:selectItems value="#{user.rolesMap}"/>
I am also not sure if the @Factory annotation would be called since I though the Factory is only used when the variable referenced is null. With your rolesMap being initialized with an HashMap object I'd think it would never get called unless you'd set it null somwhere else?
But as I mentioned this is me guessing before heaving my first coffee. ;) Somebody else with more knowledge about Seam internals will provide the proper answers I'd say. -
2. Re: SelectManyCheckbox
mirko27 Apr 9, 2006 7:19 AM (in response to mirko27)Factory did get called and rolesMap is in conversational context. It displays verything fine but when I select smth and then submit, then it says this error.
-
3. Re: SelectManyCheckbox
sunfire Apr 9, 2006 7:24 AM (in response to mirko27)Interesting, then I got a whole lot about Seam wrong and hope even more that Gavin or some other Seam guru is going to enlighten us. :(
-
4. Re: SelectManyCheckbox
mirko27 Apr 9, 2006 7:28 AM (in response to mirko27)But why doesn`t it like the value options?
Maybe I Can`t put value as Object n? -
5. Re: SelectManyCheckbox
gavin.king Apr 9, 2006 7:45 AM (in response to mirko27)I don't think the exception is anything at all to do with Seam.
Looks like a pure JSF problem. I don't think a Role is a valid value for a SelectItem.
What is the stacktrace? -
6. Re: SelectManyCheckbox
sunfire Apr 9, 2006 7:46 AM (in response to mirko27)selectItems works for me when I use Map<String, String>. Haven't tried to put others things then String into it yet since usualy a selectItem only accepts Strings as value.
btw: I had coffee now and no need to point my silly nose on my obvious errors of my first post! Please just ignore it. :/ -
7. Re: SelectManyCheckbox
mirko27 Apr 9, 2006 7:47 AM (in response to mirko27)No stack trace, just h: message that it`s not a valid value.
Role is an entity bean.