You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martijn Dashorst <ma...@gmail.com> on 2006/09/30 15:11:17 UTC

*Model#detach()

Wouldn't it be better to check against the IDetachable interface in
the detach method?

	/**
	 * @see wicket.model.IDetachable#detach()
	 */
	public void detach()
	{
		if (target != null && target instanceof IModel)
		{
			((IModel)target).detach();
		}
	}

This would open up some possibilities for IDataProvider
implementations that need some detach logic.

Martijn


-- 
<a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
for <a href="http://www.thebeststuffintheworld.com/stuff/wicket">Wicket</a>
at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
the World!</a>

Re: *Model#detach()

Posted by Eelco Hillenius <ee...@gmail.com>.
+1

Eelco


On 9/30/06, Igor Vaynberg <ig...@gmail.com> wrote:
> +1
>
> -Igor
>
>
> On 9/30/06, Martijn Dashorst <ma...@gmail.com> wrote:
> >
> > Wouldn't it be better to check against the IDetachable interface in
> > the detach method?
> >
> >         /**
> >          * @see wicket.model.IDetachable#detach()
> >          */
> >         public void detach()
> >         {
> >                 if (target != null && target instanceof IModel)
> >                 {
> >                         ((IModel)target).detach();
> >                 }
> >         }
> >
> > This would open up some possibilities for IDataProvider
> > implementations that need some detach logic.
> >
> > Martijn
> >
> >
> > --
> > <a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
> > for <a href="http://www.thebeststuffintheworld.com/stuff/wicket
> > ">Wicket</a>
> > at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
> > the World!</a>
> >
>
>

Re: *Model#detach()

Posted by Igor Vaynberg <ig...@gmail.com>.
+1

-Igor


On 9/30/06, Martijn Dashorst <ma...@gmail.com> wrote:
>
> Wouldn't it be better to check against the IDetachable interface in
> the detach method?
>
>         /**
>          * @see wicket.model.IDetachable#detach()
>          */
>         public void detach()
>         {
>                 if (target != null && target instanceof IModel)
>                 {
>                         ((IModel)target).detach();
>                 }
>         }
>
> This would open up some possibilities for IDataProvider
> implementations that need some detach logic.
>
> Martijn
>
>
> --
> <a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
> for <a href="http://www.thebeststuffintheworld.com/stuff/wicket
> ">Wicket</a>
> at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
> the World!</a>
>