Something like this...

<wicket:panel>
  <a wicket:id="link"><span wicket:id="label">Foo</span></a>
</wicket:panel>

public class MyMenuPanel extends Panel {
  public MyMenuPanel(String id, String label, Class pageClass) {
    super(id);
    Link link = new BookmarkablePageLink("link", pageClass);
    add(link);
    link.add(new Label("label", label));
  }
}

jk

On Tue, Jul 22, 2008 at 01:32:55PM -0700, Edbay wrote:
> 
> I get this approach. Can you provide the code for the panel?
> 
> <ul>
>   <!-- note: the   tag here is only for preview,
>        it will be replaced by the link panel contents -->
>   <li wicket:id="menuItem"> # Foo </li>
> </ul>
> 
> RepeatingView menu = new RepeatingView("menuItem");
> 
> menu.add(new MyMenuPanel(menu.newChildId(), "Home", HomePage.class));
> 
> if (userIsDarthVader) {
>     menu.add(new MyMenuPanel(menu.newChildId(), "Enslave Universe",
>     EnslaveUniversePage.class));
> }
> 
> -- 
> View this message in context: 
> http://www.nabble.com/How-to-build-a-dynamic-navigation-bar-tp18592899p18598120.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to