> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:wicket-develop-
> [EMAIL PROTECTED] On Behalf Of Gili
> Sent: Saturday, 12 March 2005 3:42 AM
> To: [email protected]
> Subject: RE: [Wicket-develop] Wicket prefix
>
> >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
> >
I'll have to add in here that they also use classes, but if they use IDs
then they should be untouched by wicket.
> >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
> >
These ID attribues can be strpped by wicket because the developer has added
them solely for binding components to. However, without using a prefix,
wicket can't know which ID attributes to remove. Wicket could be configured
that id='wicket-*' attributes get stripped.
> >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.
>
To avoid using non standard tags, the developer could use id='wicket-*' and
have wicket strip these tags.
> 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.
>
This puts a constraint on the html designer which I don't think is
appropriate - not for wicket to do by default.
> 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.
I agree here.
> 2) IDs within components are always stripped out because there is no
> way to ensure their uniqueness.
For IDs within components I think is too broad a category for stripping.
Say a form :
<form id='myForm' ...>
<input type='text' id='username' />
</form>
In this case, the username component is within the myForm component, however
I think it should NOT be stripped. Since the html designer can assign
styles/javascript based on its id.
However
<table>
<tr id='myTable'>
<td><div id='username'></div></td>
</tr>
</table>
Would generate duplicate divs with username. So I suggest using
<table>
<tr id='myTable'>
<td><div wicket='username'></div></td>
</tr>
</table>
Or
<table>
<tr id='myTable'>
<td><div id='wicket-username'></div></td>
</tr>
</table>
And have the username ids stripped.
> 3) No reason to use nonstandard wicket attribute ever (this one I am
> still not 100% sure we can do yet)
>
I think this should be an option for the java developer to use.
I.e.
Html designer only uses XHTML tags.
Java developer can augment the XHTML to add in extra IDs or wicket specific
tags/attributes. This will often need to be done - since the HTML designer
doesn't really need to specify every ID.
Cameron.
> 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
-------------------------------------------------------
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_ide95&alloc_id396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop