On Sat, 12 Mar 2005 15:33:19 +1000, Cameron Braid wrote:

>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.

        Sure it can! Wicket can strip the ID from components add()ed on
the Java end. Secondly, I think we just finished saying that won't need
to remove IDs from wicket components withing a Page, because those are
guaranteed to be unique. I am only proposing we strip them from within
non-Page components.

>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.

        If the ID is found within a Page then the ID will be left in
place, no problem. If the ID is found within a component such as a
form, there is no way for us to guarantee their uniqueness. You mention
web designers refering to the tag element by its ID from JS/CSS but for
JS I don't see any reason you can't use onXXX events and pass "this" to
your Javascript event. And for CSS, you're just going to have to use
the "class" or "style" tags instead of relying on different styles
based upon their ID. This isn't ideal but until Wicket adds CSS support
I don't think there is any other reasonable way to do this and still
guarantee that the ID will be unique across the document. If you've got
an idea on how to better handle this please suggest it.

>> 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.  

        Wicket can already augment tags by surrounding them with
<wicket:XXX> tags -- such as <wicket:panel> and <wicket:remove>. These
are "safe" according to the XHTML standard because they exist outside
the XHTML namespace. What is unsafe is adding "wicket" attributes to
XHTML tags. As such, I don't see any case where you'd want to use the
"wicket" attribute and can't use the "id" attribute instead. It is the
standard, why not use it? Both HTML designers and Java developers
should be refering to the same element by the same name. That's just my
view. I've yet to run into a compeling use-case for doing otherwise.

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