On Tue, 15 Feb 2005 17:27:40 +0100, Eelco Hillenius wrote:

>You're wrong, it is very common. And when using reusable components like 
>panels and borders, you can't really prevent reusing names. E.g. in 
>FeedbackPanel, a label with the name 'message' is used. So, if you 
>really want all components in your page to have unique id's, you could 
>never name a component 'message'. Same goes for labels, links... well, 
>you get the message.

        Ok, this is a good point. To my understanding, within any given
markup, the components names are guaranteed to be unique. That is, you
cannot define two components within the same name. However, within each
one of those components there could be other components that end up
with the same name and you don't get to see that because it is within a
different markup. Did i understand the problem correctly?

        In that case, we can either prefix nested components using the
name of the parent component or keep a HashMap at the top-level (Page)
and use it to check for ID uniqueness across the entire Page (even into
nested markups) and guarantee unique ID names. I feel the latter
solution is problematic because if the naming convention is not
deterministic it makes it impossible to build CSS against it (am I
wrong on this?). Well, actually, that's not 100% true. It makes it
impossible to build CSS that binds against an *id* but you could always
bind using the "class=blah" attribute. Sometimes that is enough, but
not always.

Gili



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to