views:

302

answers:

1

Currently, I do this:

<li><a wicket:id="link" href="#"><span wicket:id="name">jawa01</span></a></li>

and

item.add( new BookmarkablePageLink("link", ResourcePage.class)
   .setParameter("name", item.getModelObject().getName())
   .add( new Label("name", item.getModelObject().getName()) )
);

I want to do ommit the element:

<li><a wicket:id="link" href="#">...</a></li>

How should the java code look?

I expect something like

item.add( new BookmarkablePageLinkWithLabel(
   "link", ResourcePage.class, item.getModelObject().getName())
   .setParameter("name", item.getModelObject().getName())
);

Thanks, Ondra

+4  A: 

This is not built into Wicket, with a couple of reasons presented here.

However, you can certainly make you own component out of what you currently do to make your life easier. The constructor would take both the model for the link and the model for the label.

schmimd04