there's a mixin for this purpose (RenderClientId), so, just use it in your pagelink
On Sat, Feb 20, 2010 at 16:47, Martin Strand <do.not.eat.yellow.s...@gmail.com> wrote: > Tapestry will generate an id automatically and render it as an 'id' > attribute if you invoke getClientId() on the PageLink in question. > This is the typical use case where you would run a short script to > manipulate the element, something like this: > >> <a t:id="myPageLink">Hello</a> >> <script ...> >> document.getElementById("${myPageLink.clientId}").doStuff(); >> </script> > > > > If the 'id' attribute would be equal to your t:id at all times (as you > propose) loops would create duplicated ids: > >> <li t:type="loop" t:source="allPages" t:value="currentPage"> >> <!-- all links would get the same id, we should let Tapestry generate the >> id instead --> >> <a t:id="myPageLink">${currentPage}</a> >> </li> > > > > It is good practice get the generated id by invoking getClientId() instead > of explicitly setting your own value for 'id'. > > Martin > > On Sat, 20 Feb 2010 15:32:36 +0100, Lionel Touati <l.tou...@egencia.com> > wrote: > >> Hi List, >> >> I may have missed something, but it seems that t:Id is not transformed >> into a html ID at least for the pagelink component. It seems quite odd to >> me, as you then need to add the id field manually in the TML file. Also it >> does not seem to be consistent with the form fields for example >> >> >> I've done a patch org.apache.tapestry5.corelib.base.AbstractLink to >> support this in all links > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org