Oh and just in case you were using your carpart object somewhere else
in onpopulate.
Never use final on your jpa objects, instead if you must you can use
final on the model (or the item if you are in a list view)

Right Martijn :) quick copy paste error :)

Maurice

On Wed, Apr 2, 2008 at 1:35 PM, Maurice Marrink <[EMAIL PROTECTED]> wrote:
> It should be:
>
> protected void populateItem(Item item)
>  {
>  item.setModelObject(new CompoundPropertyModel(item.getModel()));
>  .....
>  }
>
>  Maurice
>
>
>
>  On Wed, Apr 2, 2008 at 1:23 PM, Java Programmer <[EMAIL PROTECTED]> wrote:
>  > I have narrowed my code to:
>  >
>  >         protected void populateItem(Item item) {
>  >
>  >                 final CarPart carPart = (CarPart) item.getModelObject();
>  >
>  >                 item.setModelObject(new CompoundPropertyModel(carPart));
>  >                 item.add(description = new MultiLineLabel(DESCRIPTION));
>  >         }
>  >  and get error about using read only model:
>  >  java.lang.UnsupportedOperationException: Model class
>  >  parts.car.wicket.models.CarPartDetachableModel does not support
>  >  setObject(Object)
>  >      at 
> org.apache.wicket.model.AbstractReadOnlyModel.setObject(AbstractReadOnlyModel.java:52)
>  >  What model could I use instead of LoadableDetachedModel?
>  >
>  >
>  >
>  >  Regards,
>  >  Adr
>  >
>  >  ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  >  For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>  >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to