You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Jonas <ba...@gmail.com> on 2009/10/16 11:23:58 UTC

Panel instances

Hi there,

a quick question regarding org.apache.wicket.markup.html.panel.Panel:
we recently had a bug in our software because someone directly created
an instance of Panel to render 'nothing'. This of course failed miserably
because the associated markup for Panel couldn't be found. While
the fix was easy (use EmptyPanel, which has default markup, instead), I
still wonder if there's any situation where it would be correct to directly
instantiate Panel. If there isn't any such situation, I guess it would
make sense to declare Panel to be an abstract class.
...or did I miss something here?

thanks.

cheers,
Jonas

Re: Panel instances

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Good thought.

On creating "EmptyPanel" - just use WebMarkupContainer.  It's made for that.

--
Jeremy Thomerson
http://www.wickettraining.com



On Fri, Oct 16, 2009 at 4:23 AM, Jonas <ba...@gmail.com> wrote:

> Hi there,
>
> a quick question regarding org.apache.wicket.markup.html.panel.Panel:
> we recently had a bug in our software because someone directly created
> an instance of Panel to render 'nothing'. This of course failed miserably
> because the associated markup for Panel couldn't be found. While
> the fix was easy (use EmptyPanel, which has default markup, instead), I
> still wonder if there's any situation where it would be correct to directly
> instantiate Panel. If there isn't any such situation, I guess it would
> make sense to declare Panel to be an abstract class.
> ...or did I miss something here?
>
> thanks.
>
> cheers,
> Jonas
>

Re: Panel instances

Posted by Igor Vaynberg <ig...@gmail.com>.
done in 1.5.x, in 1.4.x we will leave it as is in case people are
using it as a placeholder in unit tests (as was the case in a couple
of ours)

nice catch, thanks.

-igor

On Fri, Oct 16, 2009 at 2:23 AM, Jonas <ba...@gmail.com> wrote:
> Hi there,
>
> a quick question regarding org.apache.wicket.markup.html.panel.Panel:
> we recently had a bug in our software because someone directly created
> an instance of Panel to render 'nothing'. This of course failed miserably
> because the associated markup for Panel couldn't be found. While
> the fix was easy (use EmptyPanel, which has default markup, instead), I
> still wonder if there's any situation where it would be correct to directly
> instantiate Panel. If there isn't any such situation, I guess it would
> make sense to declare Panel to be an abstract class.
> ...or did I miss something here?
>
> thanks.
>
> cheers,
> Jonas
>