jawa01

Wicket link - add a label needed to set text?

I am currently doing 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 make an ommit element:

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

What does Java code look like?

I expect something like

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

Thanks, Ondra

+5
source share
1 answer

It is not built into the Wicket, and a couple of the reasons presented here .

However, you can make your own component from what you are doing now to make your life easier. The constructor will take both the model for the reference and the model for the label.

+7
source

All Articles