Still don't like it. It adds yet another way to work with links, and
requires subclassing to do so. What is more convenient?
new Label(new BookmarkablePageLink(this, "link"), "label", "Text");
or
new BookmarkablePageLink(this, "link") {
protected String getLabel() {
return "Text";
}
};
or
new MyCustomBookmarkablePageLinkWithLabel(this, "link", "Text");
What's next? SimpleBookmarkablePageLink, SimplePagelink,
SimpleResourceLink, SimpleExternalLink, SimpleLabel, SimpleImage,
SimpleListView, SimpleRepeatingView ?
Also, it is in (a minor) violation of Wicket's philosophy: don't mess
with markup in a magic way.
This shows clear intention:
<a href="#" wicket:id="link"><span wicket:id="label"></span></a>
new Label(new BookmarkablePageLink(this, "link"), "label", "Text");
While this doesn't:
<a href="#" wicket:id="link">Click me!</a>
new BookmarkablePageLink(this, "link");
versus
new BookmarkablePageLink(this, "link"){
protected String getLabel() {
return "Something completely different";
}
};
A designer can inadvertently change the text within the <a href> tags,
and not have any effect, only because a subclass is created.
For answering the same question over and over, that is why we have a
faq and a woogle.
Martijn
On 10/25/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
patch would be either like the attachement, or a special class,
SimpleLink (same fashion as SimpleAttributeModifier?) which would be a
WebComponent rather than a WebMarkupContainer.
Eelco
--
<a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
for <a href="http://www.thebeststuffintheworld.com/stuff/wicket">Wicket</a>
at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
the World!</a>