>No mandatory prefix.
>Have wicket leave any ID attrbiute there.
>Have wicket remove any wicket=xxx attribute.
>My reasoning is :
>
>a) html developer designs the page using ID to attach css selectors and
>javascript code we cant remove these
>
>b) java developer binds existing IDs to java components, adds extra id
>attributes and attachs non repeated components - these can be left in the html
>
>
>c) java developer adds wicket='blah' attributes for repeated components -
>these should be removed. I use wicket='' instead of id='' for repeated
>attributes, since an ID should be unique for the whole html document. where
>as wicket='id' only needs to be unique within its parent component.
hmm... well, I agree with you that if a web designer assigns an
id to a wicket component found in a Page, it should be left alone
(since it is guaranteed to be a static ID and the web developer will
ensure it is unique). I am just a little bit more sketical for IDs
within Wicket components. There is just no way you can know ahead of
time whether the ID is unique or not and any JS/CSS that refers it
should really be bundled as part of the component (as opposed to
external JS/CSS that refers to IDs used within a component). In an
ideal world, Wicket would know how to handle JS/CSS and convert the IDs
from local names to globally-unique names when it renders them into the
surrounding Page. So lets see what we agree or disagree on:
1) Agree that IDs of Wicket components within a Page may be retained
(no harm in it)
2) Disagree that IDs within a Wicket component should be retained (I
don't feel there is any way to guarantee its uniqueness)
3) You want to assign wicket='id' to repeated attributes (such as a
list) and strip them at render time. I say, lets just let people assign
"id" and strip that at render time. In the case of repeated attributes
(such as generating items inside a list component) there is no way to
generate unique IDs anyway so you might as well strip them.
On the topic of lists, I think there are two basic use-cases:
1) Mark up list entries using CSS. For example, even and odd entries
should have different colors. In such a case your component markup
should use class="color1" and class="color2" and no IDs. Problem
solved.
2) You want to refer to the nodes within a list and manipulate them
somehow using JS. In such a case, you only need a reference to the
handle of the List and then use DOM to iterate through its children
nodes. The question is how to get a handle to the List element in the
first place. One way is through Javascript events that get triggered
and pass in "this". Another way is for your web designers to assign the
List a unique ID which will not get stripped out because as I mentioned
above those IDs are guaranteed to be unique.
In either case, you don't need to assign an ID to the repeated
element, so we're safe. Am I missing a use-case?
In a nutshell, I'm hoping we can do this:
1) Web designers can assign IDs to elements in the Page and these are
not stripped out because they are guaranteed to be unique.
2) IDs within components are always stripped out because there is no
way to ensure their uniqueness.
3) No reason to use nonstandard wicket attribute ever (this one I am
still not 100% sure we can do yet)
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