On 11/6/05, Ralf Ebert <[EMAIL PROTECTED]> wrote:
> Hi,
>
> > I'm not a js nor ajax expert, but why is it not feasable to add the
> > id="xxx" to the markup. Isn't the id static anyway except for lists? I
> > guess I didn't yet clearly understand the use case.
> well, the id needs to be unique in the document, so you would have to
> use the id path (in the same way form components do it for their name
> attribute).
> The use case is: when you want to reach a document element using
> javascript in the browser, the easiest way is to use
> document.getElementById("xxx") which will give you the element having
> the id "xxx" from the browsers document model. When you want to
> inject such javascript in a component based way, the component needs
> to render an id attribute to its markup.
>
> The only thing against rendering in general would be that the markup
> gets a bit larger, especially if you use full component path as id.
> But same thing would happen if all components would add the id
> themselves. So I think thats worth a thought. But even then id
> generation should be separated from this in a application-wide way,
> so a application could decide to use a id generation strategy which
> will yield shorter ids.
>Wicket of course would only add ids to tag which have wicket:id too, because wicket doesn't know anything about all other components. I still don't understand the benefit of a automatically generated id. I mean it is generated and I can reference it only in js if I know the algorithm. Of what benefit is it than? How many components in average require an id which gets referenced by JS? Does it realy help that much to automatically generate them? you just suggest behaveours as wells. Would it make sense to have application wide behaviours which get applied to all components and one of these behaviours would than implement it? I actually prefer that over your suggest Interface. Juergen ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
