> > I have a simple class (Tag) which basically just extends
> > AbstractDomainObject and has a single String member (called
> > Description).
> >
> > In the palette contructor, I have to pass in a IModel choicesModel.
> >
> OK, so here's the scoop.  I've provided a bunch of implementations of 
> IModel, all of which implement Wicket's LoadableDetachableModel and so 
> should "do the right thing".

You've been busy!
 
> The most common model to use is EntityModel, which wraps an 
> ObjectAdapter (which in turn wraps up a single domain object entity).
> 
> In your case, though, you should use EntityCollectionModel, which can be 
> used to wrap either a standalone collection (eg returned from an action) 
> or a parented action (eg Order/OrderDetail).
> 
> Hopefully if you have a look at some of the existing panels and how they 
> use these models, you'll get the idea.

Right.. My grief is that I have a list of domain objects:

            final List<Tag> tagList = wizard.getTags();

and no obvious way to create a EntityCollectionModel from it. I'm 
guessing that I should be using the original ObjectAdapter instead of 
just doing the following:

            ObjectAdapter objectAdapter = getModelObject();
            Object object = objectAdapter.getObject();
            ToDoWizard wizard = (ToDoWizard) object;




Reply via email to