On 7/29/06, Tymur Porkuyan <[EMAIL PROTECTED]> wrote:
> What about introducing a remove(String) method that must be called to
> avoid exception? This will focus reader's attention on that there were
> another child with that name that was removed to free place for new
> one, and at the same time prevent accidental developer mistakes with
> creating components twice.
>
> In this case this will not throw exception:
>
> new TextField(this, "name");
> this.remove("name");
> new TextField(this, "name");
>
> And this will throw:
>
> new TextField(this, "name");
> new TextField(this, "name");

But this:
new TextField(this, "name");
new TextField(this, "name");

is a  legal thing to do in Wicket 2.0, while it's equivalent in 1.2:

add(new TextField("name");
add(new TextField("name");

does throw an exception. I'd *much* rather have the non-exception
(2.0) variant. It works much nicer when you do a lot of component
replacement (which is my prefered way of working, see
http://chillenious.wordpress.com/2006/07/16/on-page-navigation/).

We could make this a setting for 1.2 and 2.0, but in that case, I'd
prefer to have this proposed replace variant as the default.

Eelco

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to