Title: RE: [Wicket-develop] Wicket prefix

To understand the rationale behind this you have to consider Wicket being used in larger projects. I assume in your project that you are developing the HTML pages and the Java code yourself? In larger projects this usually does not happen. A creative web design team build the pages and a Java development team build the page logic. There is then an exercise to bind the pages to the logic by inserting the Wicket id values.

Now, the page designers may have done something fairly powerful with their pages, using say _javascript_ menus, rollovers and so on that Wicket need know nothing about. They may also have used ids within these components that happen to clash with the names that the Java development team used when building their component model. To avoid the need to revisit every single HTML element to check for id name clashes it is much better to clearly identify the ids that bind to Wicket components by having a prefix on them.

Additionally, once the application has been built, the HTML pages will still generally be maintained by the creative web design team. If all components just have an id field with no prefix then it is difficult for them to distinguish which HTML tags they can mess with and which ones they should not mess with without liaising with the Java development team. Therefore the prefix is very useful in communicating this information across multiple teams. From a maintenance point of view I also find it very useful to have the wicket prefix when I come back to maintain HTML pages that I wrote some months ago and can't remember exactly what they do any more!

Regards,
Chris

>
>       Hmm, and while we're on the topic... here is a really odd
> point:
>
>       Why do we need a wicket prefix in "id" at all? If IDs
> must be uniquely identifable across the entire document, we
> can just refer to them by their id without any sort of
> prefix. This would be much cleaner. No more voodoo magic.
>
>       If I missed something please point it out.
>
> Thanks,
> Gili
>
> On Fri, 11 Mar 2005 02:21:12 -0500, Gili wrote:
>
> >
> >     Ok, on the topic of Bug #1123751 (mentioned below) the
> main problem is
> >that when a List is rendered it reuses the same ID for all of its
> >entries. First it is important to point out that this issue is
> >List-specific and not a Wicket-wide problem. Why not strip the "id"
> >attribute from the list entries during the render process
> and users can
> >use AttributeModifier (as suggested in the bug report) to
> add in unique
> >IDs back in if they so wish. At worst, this will be just as good as
> >using a "wicket" tag for the list item and at best it could
> be better
> >because it improves standard compliance (we're follow the HTML DTD).
> >
> >Gili
> >
> >On Fri, 11 Mar 2005 02:07:24 -0500, Gili wrote:
> >
> >>
> >>    Ok, I found this:
> >>http://sourceforge.net/mailarchive/forum.php?thread_id=65850
> 80&forum_i
> >>d=
> >>42354
> >>
> >>    I'm going to give it some thought.
> >>
> >>Gili
> >>
> >>On Fri, 11 Mar 2005 02:00:18 -0500, Gili wrote:
> >>
> >>>On Fri, 11 Mar 2005 07:56:43 +0100, Juergen Donnerstag wrote:
> >>>
> >>>>100% html output compliance. Is that good enough for a reason?
> >>>>please review the discussion we had regarding that topic.
> >>>
> >>>   I don't see why you can't just use the id prefix for that...?
> >>>
> >>>>You still didn't explain why <span wicket="xxx" id="yyy" > breaks
> >>>>previewability.
> >>>
> >>>   I was thinking you were refering to using
> >>>
> >>><span wicket="xxx">
> >>>
> >>>   that is, replacing "id" by "wicket". If you're going to
> use both,
> >>>HTML browsers, validators, tools will flags your code as invalid
> >>>(since it fails to meet the HTML DTD) but I think it should still
> >>>preview fine because browsers tend to ignore errors
> silently. Still,
> >>>my view is that you can avoid all of this and just use
> "id" to begin
> >>>with.
> >>>
> >>>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