umm, so what exactly happens if i create a component that uses id.
then someone takes it and decides to put two instances of it in the
page.... they get an error, and that makes my component unusable to
them?

-igor


On Sat, Mar 8, 2008 at 12:24 PM, John Patterson <[EMAIL PROTECTED]> wrote:
> I realise that until code is submitted this is just theory but...
>
>
>  On 8 Mar 2008, at 17:12, Johan Compagner wrote:
>
>  > and if such an exception is thrown then what?
>
>  Crash.  Error page.  The standard.  It is an error and invalid to use
>  duplicate ids  on one page.
>
>
>  > then you have to set them all by hand?
>  > If by such a thing that in development you have a repeater or what
>  > ever that
>  > doesnt generate yet
>  > the second same id, but because of other larger data in production
>  > there is
>  > then suddenly in production
>  > an exception is thrown? That would be horrible.
>
>
>  Of course you can never be 100 percent certain that testing will
>  reveal every bug.  But a NPE is just as likely to escape into
>  production.  If the user specifies an id it is because they need to
>  use it in Javascript or CSS and that will clearly not work as
>  expected  if, due to a programming error, they create duplicate ids.
>  Fail fast is a good thing.
>
>  Wicket would strongly recommend using class="" instead of id=""
>  wherever possible for exactly those reasons.  But if the developer
>  cannot avoid using id wicket should let them.
>

Reply via email to