i already said this from wicket day 1.
I still don't like that you have to do this:
<a href="#" wicket:id="link"><span wicket:id="label"></span></a>
i really don't like that. It clutters markup with the span and you have to
make 2 components in wicket
And i think that the label part is a text property of the anchor. It is not
standalone.
(see it as the display value of the action value == the href)
maybe how FormComponents work:
public IModel getLabel()
{
return this.labelModel;
}
but we could say, don't make another member variable to reduce the state,
then a String getLabel() would be fine.
And one method doesnt really clutter api, maybe a nice thing would be then
you could
set the label model through the constructor (just like formcomponent should
do.... but thats just to much work)
so that it is really visible...
johan
On 10/25/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
On 10/25/06, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> 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";
> }
> };
I would find the latter more convenient as there is no label in the
markup, and it's also more efficient as it saves having an extra
component for each link.
Eelco