PropertyModel that add/read element from collection

2009-01-13 Thread Gohan

Hi, 

Is there a good way to add an element to a collection using a PropertyModel?
What I'd like to do is this: 
..
form.add(new DefaultValueDropDownChoice(id, new PropertyModel(model,
categories), jobTypes));
..

This obviously doesn't work since categories is mapped to a java.util.Set.

/Johan
-- 
View this message in context: 
http://www.nabble.com/PropertyModel-that-add-read-element-from-collection-tp21432582p21432582.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: PropertyModel that add/read element from collection

2009-01-13 Thread Michael Sparer

sure about that? did you try it?
I'm using the Palette component exactly that way (also backed with a Set)
and it just works

regards,
Michael


Gohan wrote:
 
 Hi, 
 
 Is there a good way to add an element to a collection using a
 PropertyModel? What I'd like to do is this: 
 ..
 form.add(new DefaultValueDropDownChoice(id, new PropertyModel(model,
 categories), jobTypes));
 ..
 
 This obviously doesn't work since categories is mapped to a
 java.util.Set.
 
 /Johan
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/PropertyModel-that-add-read-element-from-collection-tp21432582p21432878.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: PropertyModel that add/read element from collection

2009-01-13 Thread Gohan

Well it doesn't work for me, but mabey I'm doing something wrong.
categories in my case is a set of Strings and the result/value selected
from the DropDownChoice is a String and not a Set. Wicket says that it
cannot find method setCategories which is reasonable because there's no
such method and even if there were that's not the method I'd like to call.
Add like to call the add method of the Set itself.

-- 
View this message in context: 
http://www.nabble.com/PropertyModel-that-add-read-element-from-collection-tp21432582p21433055.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org