You might also want to check out the linksTo(Page p) method: http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/link/Link.html#linksTo(org.apache.wicket.Page)
On Wed, Dec 17, 2008 at 7:14 AM, pieter claassen <[email protected]> wrote: > Adriano, that worked, thanks!! > > Why did it work? > > Cheers, > Pieter > > > On Wed, Dec 17, 2008 at 12:11 AM, Adriano dos Santos Fernandes < > [email protected]> wrote: > >> pieter claassen wrote: >> >>> I am trying to write a menu that formats the link nicely for the page I am >>> on. So far, the novomatic tut helped the most, but there is no detail on >>> how >>> to customize the implementation. >>> >>> My strategy is to determine which page I am on and then to set an >>> attribute >>> on the link and format it with css. >>> >>> I have tried to use getParent() and getPage() on my menu panel with no >>> luck. >>> >>> public class MainMenu extends Panel { >>> ..... >>> if (getPage().getClass().equals(com.musmato.HomePage.class)) { >>> System.out.println("Homepage"); >>> } >>> >>> >> I think if you put that code on onBeforeRender it will work. >> >> >> Adriano >> >> >> --------------------------------------------------------------------- >> 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]
