hmm don't know if i like a flag.
The only thing that we do throw an exception now is to ease the developer that he does
maybe something wrong, maybe he didn't want to replace and i thought he didn't add it already.

Why not replace that with a big log warning on a debug/warn level.. So that in developerment he will see that
In deployment you don't want that exception to happen at all

johan


On 7/27/06, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:
why not add a flag to settings to allow for both as I'd guess there is
a camp for both. I don't mind auto-replace is the default though.

Juergen

>On 7/27/06, Matej Knopp < [EMAIL PROTECTED]> wrote:
> Eelco Hillenius wrote:
> > Hi all,
> >
> > For Wicket 2.0, you don't call add(component) anymore, but instead
> > create the component with the parent you create. A nice side effect is
> > that this does 'component replacement' too.
> >
> > E.g.
> >
> > TextField t1 = new TextField(this, "foo");
> > TextField t2 = new TextField(this, "foo");
> >
> > Here, t2 will be the current one, and nothing will happen with t1.
> >
> > In Wicket 1.2 (and before), if you do this:
> >
> > TextField t1 = new TextField("foo");
> > TextField t2 = new TextField("foo");
> > add(t1);
> > add(t2);
> >
> > You'll get an exception: "A child with id foo already exists".
> >
> > Though this can be helpful for debugging in those rare situations you
> > mess up, there's not a really that much of a reason to throw an
> > exception here. Actually, 2.0's behavior is much more convenient, as
> > you don't have to check whether you should add or replace; you just
> > call add, and if it exists, it'll be replaced.
> >
> > The main reason for wanting to change the semantics is that it'll make
> > it easier for us to backport components from 2.0 (like I'm doing with
> > Matej's tree right now). Additionally, it'll be an extra convenience
> > for all you fancy component developers.
> >
> > Can I have some votes on this please?
>
>   [X] sure, go ahead
>
> -Matej
>
> > [  ] no, don't do that, as it will [ fill in the why here ... ]
> >
> > Mine's +1 for changing.
> >
> > 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
> >
>
>
> -------------------------------------------------------------------------
> 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
>

-------------------------------------------------------------------------
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

-------------------------------------------------------------------------
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