Hi Martin. A typical way to do this in previous Tapestry versions is to have some simple logic functions in your component class to provide a boolean result ("this link is to the current page") which is used for each link's disabled parameter, and to select a string supplied to an informal CSS "style" parameter on each link.
T5 would be the same, except that the core PageLink component needs a few tweaks to be fit for your task - so roll your own from that - and you will have to create an equivalent of the old getPageName(). In general, use HTML templating whenever practical, as this is the natural format in which to express HTML structure. Then leave the fine-tuning of the runtime HTML to existing or home-grown components. Cheers, Nick. Martin Grotzke wrote: > On Fri, 2007-06-01 at 08:48 -0700, Howard Lewis Ship wrote: >> You have to inject your ComponentResources. >> >> There are methods for generating page render links and component action >> links as part of the ComponentResources interface. > Great! > > What's then the intended way of rendering the component? Should we > directly use the MarkupWriter with .element("a" ... etc, or is it > also possible to let the component render itself? > > If we create a page link in the template (t:pagelink), there might get > attributes rendered that are not explicitely specified. Now it would be > nice to get exactly the same markup, even if the component is created in > java code. Is this somehow possible, and is it intended to be used like > this? > > Cheers, > Martin > > >> On 6/1/07, Martin Dietze <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> I'm trying to create a component for a navigation element >>> which contains page links for all of my pages but renders the >>> currently loaded page differently (i.e. not a href, different >>> font etc.). >>> >>> It seems to me like the best way to do this is have my >>> component's java code write the lines containing the titles and >>> the underlying links. >>> >>> Unfortunately I have not been able to find any example how to >>> do this, in all examples I found the links were created in the >>> html template rather than the java code. >>> >>> Can anyone here help me out? >>> >>> Cheers, >>> >>> Martin >>> >>> -- >>> ----------- / http://herbert.the-little-red-haired-girl.org / >>> ------------- >>> =+= >>> "We waste time looking for the perfect lover, instead of creating the >>> perfect love." -- Tom Robbins, _Still Life With Woodpecker_ >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]