that looks fine. is the myservice serializable? do you see any
serialization errors in the log.

if load() is not called then detach() is not called, that means you
are removing the model or the component that contains it after
getobject() has been called but before detach() was and you are
somehow holding onto this instance and giving it to the next panel...

-igor

On Wed, Oct 29, 2008 at 9:45 AM, Neil McT <[EMAIL PROTECTED]> wrote:
>
> Its probably not fool-proof, but it has worked fine up till now........
>
>
>
> public class MyLDM<T extends MyDomainModelIF> extends
> LoadableDetachableModel{
>
>        private MyServiceIF<T> modelLoaderService;
>        private Long id;
>
>        /**
>         * Constructor.
>         *
>         * @param object the model to make 'detachable'
>         * @param modelLoaderService used to load the model
>         */
>        public MyLDM(T object, MyServiceIF<T> modelLoaderService){
>        super(object);
>        this.modelLoaderService = modelLoaderService;
>                this.id = object.getId();
>        }
>
>        public MyLDM(Long id){
>                super();
>                this.id = id;
>        }
>
>        @Override
>        protected T load() {
>                return modelLoaderService.load(id);
>        }
>
>
>      public void setId(Long id) {
>          this.id = id;
>      }
>
>
>     @Override
>     @SuppressWarnings("unchecked")
>     public T getObject(){
>         return (T)super.getObject();
>     }
> }
>
> igor.vaynberg wrote:
>>
>> what is your ldm implementation look like?
>>
>> and yes, delayed construction is always the way to go.
>>
>> -igor
>>
>> On Wed, Oct 29, 2008 at 7:44 AM, Neil McT <[EMAIL PROTECTED]>
>> wrote:
>>
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/LazyInit-error-with-LDM-in-a-panel-tp20228580p20231137.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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