In case it's useful to anyone, I thought I'd share my conclusion. After some more reading, I found that it really does need to be a full Component object rather than just an id in order to comply with the way models are supposed to work. There are some solutions that allow you to maintain an int id, but they all look pretty hacky to me.
On Wed, May 27, 2009 at 12:21 PM, Dane Laverty <[email protected]>wrote: > I'm using a DropDownChoice that looks like this: > > DropDownChoice component = new DropDownChoice("component", > new PropertyModel(task, > "componentId"), > new PropertyModel(task, > "project.components"), > new ChoiceRenderer("name", "id")); > > The problem is that task.project.components is a List<Component> and > task.componentId is an int, so I get an error that says: > > No get method defined for class: class java.lang.Integer expression: id > > I know that I can fix the problem by making the DropDownChoice's model a > Component instead of an int. However, I would like to avoid that, since that > would require reworking the Task class. Is there a way to make this work? >
